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

Repeating multiple Sections within a form

Avatar

Level 5

Good Day All;

I have designed a project status report form for our section. The user is able to repeat rows and repeat a section when they want to add a new project. Both the rows and the section are contained in a single subform.

I have been asked if it would be possible to add a button that would work a wee bit different. It word break down something like this

I basically have 3 sections.

Section 1 Division. This contains 3 fields

Section 2  Project.  This contains 3 fileds

Section 3  details     this contains  2 fields

Button1 the user would be able to repeat a row (Section 3). Adding items to a project.

Button2 the user would be able to add new Project, which would also contain section 3

Button3 the user would be able to add a new division, which would also contain section 2 and section 3.

I am thinking that that each section would have to be contained inside a subform set???

Please let me know if I have now gone off the deep end…. As well any suggestions would be great

Thanks All

Chomp

1 Accepted Solution

Avatar

Correct answer by
Level 5

Hi Chomp,

I am not sure subform sets are necessary if you define your subforms like this

Form

     -> Section1 ( subform)

          -> Section2 ( subform)

               -> Section3 ( subform)

i.e. section1 contains the subform section2 and section2 contains the section3 subform

each section would need to have the setting on the binding tab set to allow the subform to repeat

"Repeat Subform for each data item"

and then the buttons would have something like this on the click event

(assuming the buttons are included in their respective sections)

this.parent.instanceManager.addInstance (true);

// if you place the buttons elsewhere you will need to specifiy the correct path to the subform you wish to add.

hope this helps

Malcolm

View solution in original post

2 Replies

Avatar

Correct answer by
Level 5

Hi Chomp,

I am not sure subform sets are necessary if you define your subforms like this

Form

     -> Section1 ( subform)

          -> Section2 ( subform)

               -> Section3 ( subform)

i.e. section1 contains the subform section2 and section2 contains the section3 subform

each section would need to have the setting on the binding tab set to allow the subform to repeat

"Repeat Subform for each data item"

and then the buttons would have something like this on the click event

(assuming the buttons are included in their respective sections)

this.parent.instanceManager.addInstance (true);

// if you place the buttons elsewhere you will need to specifiy the correct path to the subform you wish to add.

hope this helps

Malcolm

Avatar

Level 5

Thanks Malcolm.. Worked like a charm...