Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

can subforms move?

Avatar

Not applicable
I have a two page form with three subforms whose presence is controlled by checkboxes. The user may select one or a combination of the subforms. If, for example, subform 2 & 3 are selected, I would like them to appear at the top of the page instead of in positions on the lower part of the page.
4 Replies

Avatar

Not applicable
You have to use the move instance command.



so



subform.instanceManager.moveInstance(x,y);



where x is the subform you are moving and y is where you want it.



so if you have



subform.instanceManger.moveInstance(2,0); that would move ur 3rd instance, to the first position...as its 0 based.



my x and ys might be backwards but just test it out

Avatar

Not applicable
How did you set it up so the subforms appear based on the checkboxes? I have been trying to get mine to work all day and I am running out of ideas.



Erin

Avatar

Not applicable
For the checkbox click event, have



if(this.rawValue == "1")

{this.presence = "hidden"} //you want to subform to disappear when the checkbox has a value of 1

else{ this.presence = "visible"} // and appear if the checkbox has a value of zero.



Do this for each of the checkboxes.



The outmost subform has to be flowed, top to bottom, and the form must be saved as a dynamic form.

Avatar

Not applicable
Paul, I don't think you should have to move your subforms at all - if they're in a flowed container, then the ones that you want should show up at the top, and the ones you don't want shouldn't show up. You need to use the correct Presence setting (Hidden) to make sure that the hidden subforms don't take up space on the page. (if they're "invisible" they still take up space in the layout).



Hope that helps,

Mike