0

Using menu popups alone: ids are global

asked 2008-06-12 05:23:06 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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>



delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2008-06-16 04:55:13 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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>

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2008-06-12 05:23:06 +0800

Seen: 108 times

Last updated: Jun 16 '08

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More