Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Set a parent subform presence to "hidden" if the children are not there.

Avatar

Level 3

Hi, I would like to completely erase from the layout a subform if it's children are not there because of the binded data not allowing them to be there.

The problem I'm facing is, that when the children subforms do not appear due to their bind condition not met, it's like they don't even exist, I can't even check if they are null, seems like the Javascript editor throws an error I guess.

Any ideas?.

Thanks.

1 Reply

Avatar

Level 10

Hi

You could try having a script in the calculate event of the parent subform and test for the existence of a child field, just with something like

if (this.resolveNode("Checking")

{

     this.presence = "hidden";

}

else

{

     this.presence = "visible";

}

If all you are wanting is some sort of header subform then an alternative might be to use a leader subform.  On the Pagination tab of the repeating subforms you can specify a conditional break.  If the Savings, Credit, Checking subforms are similar enough you could have a conditional leader subform on change of account description, otherwise you could have a condition of

"Checking.index eq 0"

This would add a header (or leader) before the first Checking subform.

I have updated the sample I gave in your previous post to show this approach.  https://workspaces.acrobat.com/?d=ADWN*yVsHUNg9jm1eer1aQ

In this sample I have put the leader subforms under the "Reference Object" element in the Hierarchy tab, you do this by creating your leader as normal and then dragging it (in the Hierachy palette) to the "Reference Object" element.

Regards

Bruce