Positioning a Dynamic Panel next to an object in an instance of a repeater row

Hi,

I have a repeater with a button. Clicking on that button should move a dynamic panel (at the same level as the repeater) next to the button pressed and then show it. I am able to successfully position the x coordinate of the Dynamic Panel but the Y never changes. The Dynamic Panel always displays relative to the 1st button in the repeater.

I have set up a Move To action on the button in the repeater with the following x/y scripts assigned to it:

X

LVAR1 = widget = MyRepeater
LVAR2 = widget = This (I assume this is the button in the repeater that is clicked on)
LVAR3 = widget = ActionMenu (Dynamic Panel)

[[LVAR1.x + LVAR2.x - LVAR3.width]]

Y

LVAR1 = widget = MyRepeater
LVAR2 = widget = This (I assume this is the button in the repeater that is clicked on)
LVAR3 = widget = ActionMenu (Dynamic Panel)

[[LVAR1.y + LVAR2.y + (LVAR2.height/2) - (LVAR3.height/2)]]

The only thing I can think of is that ‘This’ is resolving to the template button in the repeater rather than each instance of the button that is created in the repeater.

I’ve attached the RP file. What am I missing here?
PosiionPanelRelativetoObjectInRepeater.rp (70.8 KB)

each repeater item has its own 0,0.
If you add the background-shape as local variable and multiply its height with index-1 you get the correct coordinates.

this will break if you filter, sort, add space between repeater-rows.
PosiionPanelRelativetoObjectInRepeater.rp (70.9 KB)

1 Like

Thanks for the information Gregor. I had looked at your example showing the x/y coordinates in a grid layout. You were displaying the x/y in the OnItemLoad and I was assuming that carried over into the widgets in the repeater as well.

Here is what I ended up doing -

In the OnItemLoad handler I stored the Y coordinate of the repeater instance in a hidden field. I then assign the text of that field to a variable when the user clicks on the button. Here is the modified script.

LVAR1 is the repeater.
LVAR2 is the This.
LVAR3 is the button.

[[LVAR1.y + tY + LVAR2.y + (LVAR2.height/2) - (LVAR3.height/2) ]]

I haven’t tested whether or not these values are accurate if I sort. I’m not sorting in this particular instance but hopefully it takes sorting into account.

With hidden fields you will be able to do something. I remember that I build an example file, showing item details, including wrapping rows and all that stuff. Found it.

I think, the example file was build with an early Axure 7 Beta. Some today easily accessable variables might be calculated.

I am always using the same gvars, if something does not work after navigation with the build in navigation the page might need to be reloaded.
RepeaterTesting.rp (2.12 MB)

Thanks Gregor. For the sake of completeness I’m uploading the final version of the test file I uploaded originally. The project now uses the hidden field to store the Y loc of repeater row instance. The button in the repeater then uses that value to determine the proper offset when displaying the menu. I also added a sort button to confirm that the action menu would still appear in the proper location after a sort.

Thanks for your help!
PosiionPanelRelativetoObjectInRepeater.rp (73.6 KB)

I need to solve this exact same thing… Has someone come up with a good solution for this?

Hi nicolebtesh!

Could you post your RP file here for us to take a closer look? Please also let us know the exact functionality you’re going for, in reference to your prototype. Ty!

1 Like