0

ListBox Out of Bound

asked 2010-05-07 04:21:15 +0800

jorjor gravatar image jorjor
3

updated 2010-05-07 04:22:20 +0800

Hi,

we use a listbox component and we want to dinamically select one row... we use this:

<listbox id="listbox" model="@{bean.list}"
selectedIndex="@{list.index,load-after='next.onClick,last.onClick'}"
onCreate="self.setSelectedIndex(0);"
mold="paging" pageSize="10"
pagingPosition="bottom" width="95%">

"bean" is injected via Spring.
This code works fine in Jboss 4.2.3 in windows, but with a Jboss 4.2.3 in linux don`t work, it says:

org.zkoss.zk.ui.UiException: Out of bound: 0 while size=0 org.zkoss.zul.Listbox.setSelectedIndex(Listbox.java:662)

in this line, _items.size has to be > 0 (in windows that is true).

What's the problem? please help...

EDIT: we use zk 3.6.3 and we probe it with version 3.6.4 with the same result.

delete flag offensive retag edit

4 Replies

Sort by ยป oldest newest

answered 2010-05-09 20:59:36 +0800

PeterKuo gravatar image PeterKuo
481 2

If you remove following twi lines, does the problem still happen?

selectedIndex="@{list.index,load-after='next.onClick,last.onClick'}"
onCreate="self.setSelectedIndex(0);"

And if the model loads in both windows and linux?
It seems most likely your model in linux has not load properly.
No data in the listbox, and therefore you can't setSelectedIndex()

link publish delete flag offensive edit

answered 2011-04-20 07:21:52 +0800

felice gravatar image felice
24 1

I have the same problem whit listbox too.

I am using zk 5.0.1

any solution?

thanks
fds

link publish delete flag offensive edit

answered 2011-04-24 23:02:51 +0800

PeterKuo gravatar image PeterKuo
481 2

@felice

My previous post should already answer your problem.
It's not related to zk 3 or 5.

link publish delete flag offensive edit

answered 2011-04-26 03:45:11 +0800

felice gravatar image felice
24 1

@PeterKuo

OK thanks

fds

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: 2010-05-07 04:21:15 +0800

Seen: 871 times

Last updated: Apr 26 '11

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