Expand my Community achievements bar.

Position of field in flowed subform

Avatar

Level 8
Level 8

Hi all,

I have a form where I have a lot of dynamic fields that I show and hide depending on choices in radio buttons. I need to get the position of those fields that I have inside my flowed sub form. However when I try to get the y-coordinate of the field it only returns "0in" - I guess this is because it is flowed hence it is positioned in the upper right corner of the parent subform and is just stacked if it is shown.

However I guess there must be some way of getting the position of the field inside a flowed sub form anyway?

Please advice

Thanks in advance

Kim Christensen

Dafolo A/S

4 Replies

Avatar

Former Community Member

You will need to use the command:

xfa.layout.y(xfa object, units)

The result will be relative to the top left position of the container subform.

Paul

Avatar

Level 8
Level 8

Hi Paul,

I believe I've tried this already - but it just still returns 0 - (I have a flowed subform, that contains numerous sub_ forms and these sub forms contain the actual fields).

Is this a bad approach?

Thanks in advance

Kim

You will need to use the command:

 

xfa.layout.y(xfa object, units)

 

The result will be relative to the top left position of the container subform.

 

Paul

Avatar

Former Community Member

Can you send me the form and let me know which objects you are trying to work with and I will see if I can find out what is happening. Send it to LiveCycle8@gmail.com

Paul

Avatar

Level 10

Hi Kim,

The xfa.layout.y(xfa object, units) method only seems to work once the form layout has been applied.  If you add a subform and then in the same event try and call the xfa.layout.y() you will get "0in" back.  If this is the problem in your case you might have to move your call to xfa.layout.y() to the ready:layout event.

Bruce