0

Listbox with select mold

asked 2008-11-03 15:52:54 +0800

zkman gravatar image zkman
78

I use ZK 3.5.2-FL. If Listbox with mold="select" and rows="1" has 1 item and this item is selected then listbox method getSelectedItem() return null.

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2008-11-03 16:26:43 +0800

ziccardi gravatar image ziccardi
321 7

updated 2008-11-03 16:27:11 +0800

Try adding
<zscript>
kk.setSelectedIndex(0);
alert("hallo "+ kk.getSelectedItem());
</zscript>

right after the listbox component (kk is your listbox id), as follows:

<window title="Listbox" border="normal">
<listbox rows="1" mold="select" id="kk" >
<listitem label="option1"/>
<listitem label="option2"/>
<listitem label="option3"/>
</listbox>
<zscript>
kk.setSelectedIndex(0);
alert("hallo "+ kk.getSelectedItem());
</zscript>
</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-11-03 15:52:54 +0800

Seen: 144 times

Last updated: Nov 03 '08

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