Expand my Community achievements bar.

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

Repeatable subform is not displaying contents

Avatar

Level 3

I have a number of subforms within my main form - one of the subforms can have multiple instances so I've set it as repeatable, etc. The initial instance of the subform can be invoked from a number of different dropdown lists elsewhere in the form. Now then, I can display the repeatable subform but when I try to display other subforms within the repeatable subform, nothing is appearing - it just shows a space where the content should be! I've set the content of the repeatable subform to be hidden in the layout-ready event of the repeatable subform but still nothing is being displayed.

It's made even more strange as I have another repeatable subform elsewhere in the form and this displays fine.

Any ideas what could be the issue? Has anyone come across this before?

Thanks for any help,

1 Accepted Solution

Avatar

Correct answer by
Level 2

I believe you need to avoid doing this in your Layout Ready event. Why are you not showing/hiding the subforms in their Initialise events?

View solution in original post

4 Replies

Avatar

Level 2

Using the layout:ready event to show/hide content is a risky business, I have seen inconsitant results in the past, works in one place and not another.

According to the manual ...

Note: Scripts that fire on layout:ready should not do anything that would cause the layout of the form to change. For example, this would include anything involving subforms or tables that grow or shrink, adding fragments dynamically at run time, adding or removing subform instances, and toggling the presence setting of an object between hidden and visible.
Hope this helps.

Avatar

Level 3

Thanks for the info Mo.

The reason I put the hide/show calls in the layout ready event was because, when I put them in the form ready event, when a new instance of the repeatable subform was created none of the subforms within the repeatable subform were hidden, i.e. it would simply display the contents of the subform rather than hiding sections that should only be visible if the user made a particular selection.

It was fine for the initial instance that I'd already set up.

Any other thoughts?

Avatar

Correct answer by
Level 2

I believe you need to avoid doing this in your Layout Ready event. Why are you not showing/hiding the subforms in their Initialise events?

Avatar

Level 3

Thanks Mo - that did the trick!

I guess I was trying to get the last possible moment to action the hide/show - not sure why - but moving the form:ready / layout:ready events to the initialise event has fixed my issue.

Thanks again for the help