0

onchange in listbox

asked 2007-07-03 21:55:04 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2007-07-04 02:12:42 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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

link publish delete flag offensive edit

answered 2007-07-04 02:03:47 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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.




link publish delete flag offensive edit

answered 2007-07-04 01:58:30 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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

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: 2007-07-03 21:55:04 +0800

Seen: 1,112 times

Last updated: Jul 04 '07

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