Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

Visibility of subforms in a dynamic form

Avatar

Former Community Member
Hello,



Assume that we have three subforms (one under the other). The first one is like a table and grows dynamically clicking on a button ("Add row").

I would like if the 2. subform will be visible only if it is on the same page as the 3. subform. (By default both of them are visible)



I added the following code the layout:ready event of the 2.subform, but it does not work:

//----------------------------------------------------------------------

var subform2PageNumber = xfa.layout.page(this);

var subform3PageNumber = xfa.layout.page(this.parent.ThirdSubform);

var nodeLength = this.nodes.length;



if (subform2PageNumber==subform3PageNumber){

xfa.host.messageBox("Make it visible");

this.presence = "visible";

}

else{

xfa.host.messageBox("Make it invisible");

this.presence = "invisible";

}

//----------------------------------------------------------------------



Always I got the correct message, but the 2. subform did not became invisible (it is always visible). What is wrong? What should I do in other way ?
0 Replies