Looking for an easier way to highlight the selected nav item (and un-hilite others)
In a number of places in the app I'm prototyping at the moment, there is a side-nav with anywhere from four to a dozen or so selectable items.
Presently, the "brute force" way I've implemented this is to create an On Click event with an action for every item in the nav group. One of the actions styles the clicked item to the highlighted appearance, while the others style each of the other nav items to the un-highlighted appearance.
This seems clunky and crude, and is a real pain to update. If, for example, a new nav item is added, then I have to add a new action to all of the existing events to un-highlight them when the new item is clicked.
Even worse, if I change the nav item style (as I had to do recently when we changed the font size of the nav text), then on a screen with 11 nav items, shrinking the font from 11pt to 10pt necessitates 121 separate trips to to the action editing panel (i.e., 11 actions for each of 11 nav items). That is a lot of window opening and closing.*
If there's a more efficient way to implement highlighting just one item out of a group of items, I would love to learn it!
If, for example, an action that can restyle multiple items at once, or a way to restyle an item based on a variable (that is, an action that restyles an item selected by a condition — in my case, a variable identifying the previously selected nav item, rather than restyling all 11 items every time).
* To be honest, I didn't actually make all 121 trips to the action window: After changing 11 actions for the first nav item, I saved, closed Justinmind, unzipped a copy of the prototype, edited the XML in a text editor, then re-zipped it. This ended up being a LOT faster.