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

controlling nested subforms

Avatar

Level 2

hi i have a form that has several nested subforms in it (mainForm > subForm1 (mainForm.subForm1) > subForm2 (mainForm.subForm1.subForm2) > subForm3 (mainForm.subForm1.subForm2.subForm3)).

In each subform there is a drop down list object than when you select an item it dislays a sub form, the first level works without issue (javascript:change, for the drop down list) i.e.

mainForm1.DropList::change - (Javascript, client)

var newValueA = this.boundItem(xfa.event.newText);

switch (newValueA){

case "1";

mainForm1.subForm1.presence = visible;

case "2"

mainForm1.subForm1.presence = hidden:

}

however when in the next sub form (subform1) which is set to be either hidden or visible above:

mainForm1.subForm1.DropList::change - (Javascript, client)

var newValueA = this.boundItem(xfa.event.newText);

switch (newValueA){

case "1";

mainForm1.subForm1.subForm2.presence = visible;

case "2"

mainForm1.subForm1.subForm2.presence = hidden:

}

nothing happens and when i debug using the javascript debugger i get: invalid assignment left handside.

Is it not possible to have 3-4 subforms deep that display or are hidden depending on user input? or am I using the wrong code to reference to this dynamic appearing sub form?

any ideas would be fantastic,

Keith

1 Accepted Solution

Avatar

Correct answer by
Level 2

In my original form i used hyphens instead of under scores and this was why the form wasnt working.

View solution in original post

2 Replies

Avatar

Correct answer by
Level 2

In my original form i used hyphens instead of under scores and this was why the form wasnt working.

Avatar

Level 2

sorry i had used hyphens in the subform names i.e. sub-form instead of sub_form, classic school boy error!