Conditionals of "This" for menu


#1

I’m looking for some wisdom in building conditional statements.
In the left accordion menu, I would like for all my top level click statements to be the same (except for the onclick page link)
Such as… OnClick close all other menus and open THIS menu… I was wanting to not have to be explicit in the menu item names which is what I did in the first working draft then became a LOT of work to maintain. Let me know if you this is clear as mud… but here’s a link which should explain some.

https://r7n0q4.axshare.com/#c=2


#2

Maybe a way to go is to raise an event.
See https://docs.axure.com/axure-rp/masters/raised-events/ (works also for Axure 8).

This requires that each of your 4 expandable menu items are masters (whati’d recommend anyways).
When clicking on the menu item, you

  1. raise an event ‘onMenuItemClicked’
  2. you expand the menu item as you’re already doing it now.

On each menu item master you listen on the event ‘onMenuItemClicked’ and collapse it when it occurs.


#3

I’m not sure I know how to do that my friend. Yikes! sounds complicated… anywhere you know of that offers examples of this method?


#4

what do you mean by “listen on the event”


#5

Sry I didn’t find the time yet to post an example, so I can’t assure if it’ll definitely work like this. But I’m pretty sure.
When you raise en event, you can give it a name (e.g. ‘onMenuItemClicked’). This event will then be available like the other standard events (onClick, onPanelStateChanged etc.).
So when you click on a menu item, all of your menu items should then collapse on your custom event onMenuItemClicked (see subtitle ‘Using a Raised Event’ in the link I posted before.).


#6

I dont know why I’m not seeing it… I’m using 8RP. (latest full release)


#7

I guess in your right screenshot you’re still on the master and not on the instance of the master. And now I realize that you’re on the same point as in the beginning. You would have to tell each other 3 menuitems to close by calling them explicitely by their name.
So, I don’t see a way to achieve your goal.


#8

well… thanks anyway. Would be great to have others contributing and offering some feedback. I like puzzles and all but… when the tutorial pages gives guidance as if we are all using the BETA version… kinda hard to follow along.


#9

In your place, since you only have 4 menuitems, I wouldn’t bother to call them explicitely by name.

Still I’d be curious in how to solve your problem, imagine you’d have 20 (or a dynamic number of) menuitems.


#10

Without actually seeing your .rp file, I can’t tell exactly how you’re going about things so I hope this isn’t something you’ve already tried:

You can create a single master for your expandable list and then reuse it for all the different sections of your site. To handle the the:

you can use “Selection Groups” to make that much easier.
image

Now, for it to work across all instances, there’s an option in the properties of masters (and repeaters, as well) called “Isolate Selection Groups” and it’s toggled “on” by default. Turning that off lets that one selection group work for all the masters on the page.
image

One way to address:

is to use a repeater inside your master and raise an event OnPageLoad to add the items you want. Configure the repeater item’s OnClick event to set a global variable and raise an event. You can use the same “Selection Group” method as above to handle the selection states inside the repeater.

Here’s an example that will probably be far more help than my explaination :
Dynamic_DropLists.rp (82.4 KB)

Like I said before, I’m not sure if this is what you’re trying to accomplish, but I hope it helps.


#11

I feel humbled and in awe of your mastery! Looking for a job in Indiana by chance? cost of living is so much less than in Austin! : ) it took me 30mins to figure out everything that you had done. But I now think I’m tracking… I’ll keep you posted as I’m work to implement this approach which is exactly what I was hoping knew could be done… but didn’t know how to make it happen.


#12

{chuckle} Glad I could help. Let me know if you have any other questions.


closed #13

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