Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

Expdant to fit, height value


Former Community Member

I have a textfield "t1" set to expand to fit for the heigth value.

I want some other textfields have the same heigth that t1 when it is growing up.

In the script event ,t1.h has 0in as value when it is expand to fit. How can I take the h value of my textfield ?

3 Replies


Former Community Member
When you ask for the h value in that way you are asking the template dom. The value reported will be for when it was loaded. You need to ask the Layout Dom for the same value. It will have the updated information. You can use code like this:

var oH = xfa.layout.h(txtDescription, "in");

this.h = oH + "in";

where txtDescription is the name of the field. You can put this code on the Layout Ready event of the field that needs to adjust size.

Make sense?



Former Community Member
It works fine, thanks.

The Layout Ready Event happends the first time the pdf is print and every time the layout is modify ?