-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=5025387
By: msrednsi
I'm trying to use a menu pop up alone, connected as the pop up of a button, when it's clicked the menu pops up. The problem is that the menus are confused if their ids are equals on the same desktop in spite of being declared on diferent windows, here is simple example:
What message will be shown? Hello or Goodbye, press both bottons, only last one is shown.
<vbox>
<window title="Popup" border="normal">
<menupopup id="popupmenu">
<menuitem label="About ZK">
<attribute name="onClick">
alert("hello");
</attribute>
</menuitem>
</menupopup>
<caption>
<toolbarbutton label="popup" popup="popupmenu"/> </caption> </window>
<window title="Popup" border="normal">
<menupopup id="popupmenu">
<menuitem label="About ZK">
<attribute name="onClick">
alert("goodbye");
</attribute>
</menuitem>
</menupopup>
<caption>
<toolbarbutton label="popup" popup="popupmenu"/> </caption> </window>
</vbox>
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=5034826
By: waterbottle
Hi,
For some implementation reason, the client side id of popup,menupopup are global(but it still follow IDSpace concept at server side).
you can append spaceOwner's uuid to popupmenu to work around this.
for example :
<window title="Popup" border="normal">
<menupopup id="popupmenu${spaceOwner.uuid}"> <menuitem label="About ZK 2"> <attribute name="onClick"> alert("goodbye"); </attribute> </menuitem> </menupopup>
<caption>
<toolbarbutton label="popup" popup="popupmenu${spaceOwner.uuid}"/>
</caption>
</window>
Asked: 2008-06-12 05:23:06 +0800
Seen: 108 times
Last updated: Jun 16 '08