-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4395016
By: cmaniac
Hi all of you
Can I use onchange event in a Listbox? directly in *.zul files? I mean to have not use eventlistener?
thanks
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4395241
By: jebberwocky
Dear CmaniaC
In additional, a client side javascript action can be assigned to it by "action"
attribute
Ex:
<listbox rows="1" mold="select" action="onchange:alert('test')" >
<listitem label="option1"/>
<listitem label="option2"/>
<listitem label="option3"/>
</listbox>
Or Developer Guide Page.155
If you use this CSA(client side action) approach, you will have to pass the value back to Server Manually.
Please check the ZK wiki
http://en.wikibooks.org/wiki/ZK/How-Tos#Pass_JavaScript_variable_value_to_ZK_Ser
ver
Thank you
Jeff Liu
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4395236
By: zanyking
What onChange events you want to fire?
Because Listbox seems has no text area for editing, so the most reasonable onChange events here should be add or remove.
I'm not try it myself, but you can take a look at :
Component::onChildAdded()
Component::onChildRemoved()
I think add listening action in *.zul to these two will works.
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4395230
By: jebberwocky
Dear CmaniaC
You might be interested this:
<listbox rows="1" mold="select" onSelect="alert(self.getSelectedItem().label)"
>
<listitem label="option1"/>
<listitem label="option2"/>
<listitem label="option3"/>
</listbox>
If I misunderstand your question, please inform me.
Thank you
Jeff Liu
Asked: 2007-07-03 21:55:04 +0800
Seen: 1,112 times
Last updated: Jul 04 '07