Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Pre-defined AEM form

Avatar

Level 2

Hi,

I am trying to create a form with validations. I chose the out of the box AEM form component. I am able to achieve validations using custom validators. Also I have written custom action.

The problem is, every time I need this form, I have to drag and drop the form components. I cannot have predefined reusable form. All form related components mandate that they are supposed to be used under a parsys. This is really limiting the re-usability of the form components. To solve this problem I need to take one of the following ways :

  1. Create a template and parsys and form components in the template. Use this template to create pages and get the predefined form. This has a disadvantage. This is still not a reusable component but a standalone template and cannot be used in conjunction with other components.
  2. Dynamically add components to parsys ? Can anyone please shed some light on this ?
  3. Create a custom parsys extending the existing one to add some form components by default ? Can this be done ? If yes how ?
1 Accepted Solution

Avatar

Correct answer by
Level 2

I am able to achieve the solution with the procedure mentioned in 

http://versatileankur.blogspot.in/2014/11/component-with-default-components-in-cq5.html

 

Thanks All.

View solution in original post

4 Replies

Avatar

Level 10

Personally - I would develop this form component and add it to the sidekick so an author can drag it from the sidekick to a web page during design time. That is best practice when using AEM. 

Avatar

Administrator

Hi pvo008

Option1

There is a concept of Pre-loading form Values. If this could help you.

Link:- https://docs.adobe.com/docs/en/cq/5-6-1/developing/developing-forms.html#Preloading Form Values

 

Option2

Stackoverflow :- Reusing Forms

Link:- http://stackoverflow.com/questions/20879342/reusing-the-cq5-form-into-the-mywebsite-components-is-no...

 

Option3

Adaotive forms.  Here we can use XML schema of existing form to create new form.

Link:- https://helpx.adobe.com/aem-forms/6/creating-adaptive-form.html

 

I hope this would help you.

 

Thanks and Regards

Kautuk Sahni



Kautuk Sahni

Avatar

Correct answer by
Level 2

I am able to achieve the solution with the procedure mentioned in 

http://versatileankur.blogspot.in/2014/11/component-with-default-components-in-cq5.html

 

Thanks All.

Avatar

Level 10

AEM components are dragged from the side kick onto a web page during design time by AEM authors.

This use case should not be considered an issue as the product was designed this way. 

However - you can place default components in parsys:

http://blogs.adobe.com/experiencedelivers/experience-management/default-components-in-your-parsys/