-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I have a tabbox with many tabs. I want the user to be able to right-click on any of the tabs and it will pop-up a context menu. The options in the menu are the same for all the tabs. Can I use a single Menupopup or do I need separate Menupops for each Tab?
If I can use a single Menupopup, how do I detect which tab caused it to popup?
Darius,
Here is some code that illustrates what you ask:
<zk> <window> <tabbox> <tabs> <tab id="tab1" label="Tab #1" context="editPopup"/> <tab id="tab2" label="Tab #2" context="editPopup"/> <tab id="tab3" label="Tab #3" context="editPopup"/> </tabs> <tabpanels> <tabpanel > <label value="Content for Tab #1"/> </tabpanel> <tabpanel> <label value="Content for Tab #2"/> </tabpanel> <tabpanel> <label value="Content for Tab #3"/> </tabpanel> </tabpanels> </tabbox> <menupopup id="editPopup"> <attribute name="onOpen"> if(event.isOpen()){ Component callingComp = event.getReference(); msg.setLabel("Called from "+callingComp.getLabel()); } </attribute> <menuitem id="msg" /> <menuseparator /> <menuitem label="File" /> <menuitem label="Edit" /> </menupopup> </window> </zk>
Hope that is of value to you.
Kind regards,
Todd
Asked: 2010-07-21 12:34:18 +0800
Seen: 445 times
Last updated: Jul 22 '10