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.

Positioning an object at run time

Avatar

Level 2

Hi All,

I have a form where on selecting values from a drop down, certain fields should appear while a few should be hidden. I'm using scripting.

Explaining in detail:

When I select Value1 = Field A should appear and B should be hidden

When I select Value 2 = Fields A and B should appear (A appears above B)

When I select Value 3 = Field A should be hidden and B should appear (in this case, B should appear in the location where A was appearing) ----- This is my question  - How ?

Thanks & Regards,

Sandhya

3 Replies

Avatar

Former Community Member

This would be controlled through script. I created a sample for you. The original positions of the objects are relative to the container that they are in. In My example they are contained within a Page subform and that page subform is .25 inches from the edge of the page so you can calculated the position or simply use the command I have in the script (then print it out to the screen so you know its original position - I commented out the message).

Anyways, have a look and see if this is what you want .....BTW - I added those two line to make sure that I moved the field to the proper location .....they are not needed.

Hope that helps

Paul

Avatar

Level 2

Hi Paul,

The following  code is not working for me

//Return Field A to original position
var oAy = xfa.layout.y(FieldA, "in");
//app.alert(oAy)
FieldA.y = ".625in";

Maybe because FieldA in my case is a collection of 2 text fields and texts. I have wraped them in a subform. If I replace FieldA with the name of the subform, it is not working.

Is there any solution for that?

Thanks,

Sandhya

Avatar

Former Community Member

I would need to see the form in action ....can you send the form to LiveCycle8@gmail.com

Paul