Repeater and Master menu selected state on page load

Hello guys,
I have a simple question:

I have a repeater into a master that will work as a menu.
On click on the repeater item I open the dedicated page and all here is good.
The thing is that I have a style on each the repeater item, and I want that the right menu link of the repeater will show the selected state on page load.Is this possible with a master?

Hope the request is clear.

I enclose a rp file as start.

menu.rp (90.6 KB)

Yes, there are a number of ways you could do this. In a Master, you can make use of the Page Loaded event, and with a repeater (in a Master or not) you can make use of the repeater’s Loaded and Item Loaded events. In this case, I think the most simple and most reliable approach is to use Item Loaded to test the page name against the row’s [[Item.pages text]] value, and if it matches, set the “label” widget to selected.

A few minor changes will make this easier yet. If you use the same exact text for the name of your pages and the menu items (“Page 1” and “Page 1”) then you don’t have to do string manipulation to match “Page 1” with “Page_1” and it should make more sense for the user as well. For the Click or Tap event, you can use one statement to “Open Link [[Item.link]]” where “link” is a column in your repeater dataset. The value in each row is a “reference page” (right-click the datasheet cell and select Reference Page…, then point to a page in your prototype.)

menu.rp (87.5 KB)

1 Like

Thank you! This is exactly what I was searching for! Amazing!
Thank for your help!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.