adobe / aem-core-wcm-components

Standardized components to build websites with AEM.
https://docs.adobe.com/content/help/en/experience-manager-core-components/using/introduction.html
Apache License 2.0
723 stars 737 forks source link

[Form] Not possible to add additional fields through form action configuration #79

Open henrykuijpers opened 6 years ago

henrykuijpers commented 6 years ago

When I configure a form action in the Container component, the "addfields.jsp" (or "addfields.html") script is not invoked.

Back in the "old" days, we had in the FormsHelper the startForm(request, response) function, that would at the very end of setting up the form, execute: String actionType = (String)properties.get("actionType", ""); if(actionType.length() > 0) { runAction(actionType, "addfields", formResource, request, response); }

This, however, is missing in the new Container component. Therefore, we are unable to add custom fields (or other HTML) to the forms that we use.

raducotescu commented 6 years ago

@henrykuijpers, thanks for the suggestion! I'll bring this issue to our planning meetings. For the record, I don't think the new Core Components should be 100% compatible with the "foundation" components, hence why I prefer the former issue title.

henrykuijpers commented 6 years ago

I don't mind living without the addfields.html that we used previously, as long as there is a way to achieve the same functionality.

A simple use case where this would be needed: We have a newsletter signup form action. It always needs 3 inputs from the user (e-mail address, first name, last name). We could achieve this functionality with form fields, that are added manually to the form after configuring the action. But this burdens the author with additional work (that he has to repeat all the time). Also, that work he has to do will always be the same.

The 3 fields are really tied to the form action that is chosen and therefore the form action should be in control of them being added.

gabrielwalt commented 6 years ago

(CQ-4224505)