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

Subforms not moving like they should

Avatar

Level 3

Okay I know I must be doing something wrong. I have been working on this since last night and can't seem to figure it out. I am trying to build a form where once a check box or radio is "clicked" new questions appear. I have been able to hide the fields using the presence "hidden" command. I believe that the hidden command will exclude the object from the form layout whereas the invisible just makes it invisible but still consuming space on the form. The problem I am having is that I cant get the subforms that the additional "hidden" material is enclosed in to move up the form when the user does not click on the radiobutton or checkbox to display the information that is hidden. I guess in other words the hidden information I have is still consuming blank space on the form even though it has not been prompted to appear. Does any of the problem I am having have anything to do with the pagination tab which is grayed out in the subform object palette? Thanks for any help you may be able to give    

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

You are correct in your description of invisible v hidden.

I suspect that the main problem is that you have not set the containing subform to flowed. For example if you have the checkboxes and questions on "page1", then this would need to be set to flowed. This is needed to allow objects to "flow" to take up space when objects are set to hidden. Also the form will have to be saved as dynamic (I suspect that you have done this already).

When working with flowed layouts it is a good idea to group static objects in positioned subforms and then these will keep their relative positions as the subforms move up and down. In your case your optional questions would be in a subform and you would visible/hidden the subform, not the question.

Here are some examples.

Hope that helps,

Niall

View solution in original post

3 Replies

Avatar

Correct answer by
Level 10

Hi,

You are correct in your description of invisible v hidden.

I suspect that the main problem is that you have not set the containing subform to flowed. For example if you have the checkboxes and questions on "page1", then this would need to be set to flowed. This is needed to allow objects to "flow" to take up space when objects are set to hidden. Also the form will have to be saved as dynamic (I suspect that you have done this already).

When working with flowed layouts it is a good idea to group static objects in positioned subforms and then these will keep their relative positions as the subforms move up and down. In your case your optional questions would be in a subform and you would visible/hidden the subform, not the question.

Here are some examples.

Hope that helps,

Niall

Avatar

Level 3

Thanks Niall Turns out I did not have the page 1 subform for some reason. Must have deleted it by accident. Anyway, Thanks again, it worked great

Avatar

Level 10

Hi,

Glad you got it working.

In relation to page1, I was just referring to the page container in the hierarchy.

When you start a form it is un-named:

Parallels Desktop.png

It is a good idea to name pages (and objects) as you go. I tend to name pages in sequence and with a small "p" (to differentiate from Master Pages):

Parallels Desktop.png

It doesn't matter what you call the pages, as long as you are some way consistent.

Good luck,

Niall