Revision history [back]

click to hide/show revision 1
initial version

asked 2017-05-03 12:11:30 +0800

hrv gravatar image hrv

How to set selected combobox when using setModel

Hi All,

I am filling up my Combobox using setModel method, now my problem is how can I set selected the value. I am using call back listener "onInitRenderLater" but when I try to call setSelectedIndex it gives me following error.

org.zkoss.zk.ui.UiException: Out of bound: 20 while size=0

And rightly so, because as I understand this, it loads the content when I start typing.

Please help me here to set selected item.!

How to set selected combobox when using setModel

Hi All,

I am filling up my Combobox using setModel method, now my problem is how can I set selected the value. I am using call back listener "onInitRenderLater" but when I try to call setSelectedIndex it gives me following error.

org.zkoss.zk.ui.UiException: Out of bound: 20 while size=0

And rightly so, because as I understand this, it loads the content when I start typing.

Even the box.getItemCount() returns 0, Only when I start typing that gets updated, that too it shows only selected items' count. (If I have written just a, it gives me the count of items starting with a only)

Please help me here to set selected item.!

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