0

load on demand combobox items

asked 2012-01-25 12:11:26 +0800

hosarb gravatar image hosarb
45

Hi.
I need to have the load-on-demand feature like the listbox in my combobox.
Listbox load-on-demand
And I don't want to use the bandbox sample :
bandbox as combo box

I know the autocomplete feature and the ListModels.toListSubModel list model that loads only some of the items.
but this is not enough.

delete flag offensive retag edit

7 Replies

Sort by ยป oldest newest

answered 2012-02-01 00:52:48 +0800

samchuang gravatar image samchuang
4084 4

Hi,

I think ZK EE version's combobox has ROD,

link publish delete flag offensive edit

answered 2012-02-06 06:48:25 +0800

hosarb gravatar image hosarb
45

Hi,
Would you please tell me how to do it?
a sample or a link that shows the feature?

because I have the EE version, and I don't know how to do it!

link publish delete flag offensive edit

answered 2012-02-10 00:55:50 +0800

samchuang gravatar image samchuang
4084 4

if your combobox use Model, I think it use ROD

link publish delete flag offensive edit

answered 2012-02-13 12:12:07 +0800

hosarb gravatar image hosarb
45

Hi
I think my question has no enough details.

I have a combo box that its data count is over 1000 items.
so for loading the page, it takes a lot of resource of the client.

the combo items, are provided by a ListModelList.

when I open the combo, it takes a lot of time to open, and some times the browser hangs and I have to close it.

so I need a way to load the items partially, not all at once.

I tried the autocomplete feature and the ListModels.toListSubModel but my problem is that in this way, the combo only loads 15 items at once, and I can not see the other items.

I need a way that tells the combo load 15 items (for example) at once, and if the user scrolls down, load the next items.

the examples that I found in the ZK demo are not what i need.
in both of them I can not use the combobox component, but I need to use it.

so any idea?!

link publish delete flag offensive edit

answered 2012-02-14 02:19:52 +0800

RichardL gravatar image RichardL
768 4

I have a feature request to add a setter for data in SimpleListModel, i.e. this field:

private final Object[] _data;

I think it might be relevant in your case, too. http://tracker.zkoss.org/browse/ZK-795

link publish delete flag offensive edit

answered 2012-02-14 09:30:44 +0800

hosarb gravatar image hosarb
45

Hi Richard

I red the links, but my problem is not fetching the data. I don't need to fetch the data in pages.
As I mentioned before, the "ListModels.toListSubModel " works fine, but the problem is that the solution is linited in items count, and I need to load more data when scrolling down or up.

THX

link publish delete flag offensive edit

answered 2012-02-16 01:00:27 +0800

samchuang gravatar image samchuang
4084 4

updated 2012-02-16 01:01:21 +0800

Hi

if you use ZK EE version, Combobox won't create comboitem when loading page, so the loading time is short

I tested it use the code below

<window title="Test" border="normal">
 <zscript><![CDATA[
   List  strset = new ArrayList();
   for (int i = 0; i < 1000; i++) {
	   strset.add("" + i);
   }
 ]]></zscript>
<combobox>
	<comboitem label="item ${forEachStatus.index}" forEach="${strset}"></comboitem>
</combobox>
</window>

it will create comboitem when user click the combobox's button

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: 2012-01-25 12:11:26 +0800

Seen: 463 times

Last updated: Feb 16 '12

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