Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Find objects with same vertical position in flowed layout

Avatar

Level 4

Hi there,

in a click-event I would like to change the height of all checkboxes that lie in the same horizontal row.

As it is a flowed layout some checkboxes may be in the next row - those I do not want to change.

My question is therefore: How can I find out the y-coordinate in a flowed layout?

With that information I would find my other objects.

(this.y delivers "0in" of course in a flowed layout.)

I do hope anyone has a good idea for that!

Uli

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

You may want to try xfa.layout.y("objectname", "units you want returned ....default is points"). The same format applies for x and h which you may need later on.

Paul

View solution in original post

7 Replies

Avatar

Level 10

For increasing the height why do you need Y coordinate? The Y coordinate values are disabled in Flowed Layout. They are available in Position layout.

May be if you can eloborate what you are trying to achieve with Y coordinate then there might be an other way to do it..

Thanks

Srini

Avatar

Level 4

Oh, apparently I failed to make my point clear.

Consider this example:

[  ] Checkbox1     [  ] Checkbox2     [   ] Checkbox3

[  ] Checkbox4

Whenever I click on one of those checkboxes I would like to change the height of all checkboxes in the same row (this.h = ...)

[Why this is necessary is too complicated to explain. These are forms that are part of fairly big environment with very specific reader add-ons .....]

Thus: If I click on checkbox2 I would like to find the checkboxes with the same vertical position (in this case: checkbox1, checkbox2 and checkbox3) to change their heights.

As it is a flowed layout checkbox4 has slipped over onto the next row. It is vertically further down in the current layout. Therefore I do not want to change its height.

What I need, is not really the y-attribute of the checkbox, but the vertical position in the layout. I just cannot find an attribute that delivers this information.

Does this make it clear?

Avatar

Correct answer by
Former Community Member

You may want to try xfa.layout.y("objectname", "units you want returned ....default is points"). The same format applies for x and h which you may need later on.

Paul

Avatar

Level 4

Paul,

that looked like a promising hint! Thank you.

I tried

xfa.host.messageBox ("y: " + xfa.layout.y(MYCHECKBOX, "in"));

Strange thing is, that I keep getting "-1" as result.

Avatar

Level 4

I just stepped into the wrong event. In layoutReady the result is

always "0"


Avatar

Former Community Member

It is 0 because it is relative to the subform location ...if you try the x, or h you will get a positive value.... I think. I am getting 0 as well but if I try an object on a positioned subform I get a value based on the location of the subform. I woudl think that if you try the object n teh 2nd row you should get a different value (assuming they are in the same subform).

Paul

Avatar

Level 4

Paul,

while you were typing your reply I did some experiments and came to the same conlusion. Indeed, that's it! It works:

xfa.layout.y(this.parent, "in") does the trick!

Thanks a lot!!!

Uli

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----