How to get the dimensions (h & w) of dynamic objects

Avatar

Avatar

Yasser__AST-IT_

Avatar

Yasser__AST-IT_

Yasser__AST-IT_

10-06-2011

Hi,

Is there any way to get the dimensions (h & w) of dynamic objects (such as subform, or text field) via scripting?

To get way I was looking for, I tried using "object.h" or "object.w" in various events timings (i.e., @ initialize, form:ready and layout:ready) but I always get the result as "0".

If someone there knows a better way to place (event) the code or have different approach, I do appreciate it.

BR,

Yasser    

View Entire Topic

Avatar

Avatar

Yasser__AST-IT_

Avatar

Yasser__AST-IT_

Yasser__AST-IT_

11-06-2011

Hi Stephen,

Thanks for the reply.

My question is about getting the dimension of a suform that expand its height dynamically based on the adding more subforms, for example!

For example if you have a subform call mySubForm and if its high is "5cm", then if you run the following script:

          xfa.host.messageBox("The height of my subform is: " + mySubform.h);

Will return "The height of my subform is: 5cm" only if the "Expand to fit" property is not checked.

Once the "Expand to fit" property is checked, then the answer will be "The height of my subform is: 0cm".

It seems that this behavior is mentioned across all objects that expands/shrinks dynamically based on it's content.

Now, my question still valid; Is there any way to know the height/width of dynamically sized object at runtime?

BR,

Yasser