0

Preloading a listbox

asked 2009-12-15 09:17:01 +0800

Fooch gravatar image Fooch
48 2

I can't seem to get this to work. When I load my listbox there is a little over 1000 records and I want to preload that listbox so that when scrolling it does not have to load the next records into memory, I want it nice and smooth. Below is the code as it is now.

I am also runnig a WebLogic server on my laptop which of course slows down my laptop. Is the issue with the listbox? Or is the issue with the fact that I am on a local weblogic server? It takes a long time and a bunch of hoops to get server space here at work so I installed a weblogic server as a temp fix so I can work while waiting.

<listbox id="terminalMasterList" preloadSize="2000" rows="14"
model="@{terminalMasterModel.entities}"
selectedItem="@{terminalMasterModel.selected}">
<listhead sizable="true">
<listheader label="Number" sort="auto(terminalNumber)" />
<listheader label="Abbreviation" sort="auto(terminalAbbreviation)" />
<listheader label="Active?" sort="auto(terminalStatus)" />
<listheader label="Hub?" sort="auto(hubStatus)" />
<listheader label="Name" sort="auto(terminalName)" />
<listheader label="City" sort="auto(cityName)" />
<listheader label="State" sort="auto(stateCode)" />
<listheader label="Zip Code" sort="auto(postalCode)" />
<listheader label="Time Zone" sort="auto(terminalCityCode)" />
<listheader label="Type" sort="auto(hubType)" />
<listheader label="Hub" sort="auto(hubParent)" />
</listhead>
<listitem self="@{each=terminalMaster}">
<listcell label="@{terminalMaster.terminalNumber}" />
<listcell label="@{terminalMaster.terminalAbbreviation}" />
<listcell label="@{terminalMaster.terminalStatus}" />
<listcell label="@{terminalMaster.hubStatus}" />
<listcell label="@{terminalMaster.terminalName}" />
<listcell label="@{terminalMaster.cityName}" />
<listcell label="@{terminalMaster.stateCode}" />
<listcell label="@{terminalMaster.postalCode}" />
<listcell label="@{terminalMaster.terminalCityCode}" />
<listcell label="@{terminalMaster.hubType}" />
<listcell label="@{terminalMaster.hubParent}" />
</listitem>
</listbox>

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2009-12-15 19:36:55 +0800

joylo0122 gravatar image joylo0122
688 1
www.zkoss.org

updated 2009-12-15 19:40:48 +0800

@Fooch

Hi Fooch, you can try to use paging listbox instead preloadsize, all you need is add this code:

<listbox id="terminalMasterList" ...... mold="paging">

About the issue slows down your laptop, you can use another app server(like tomcat) to check if it is a problem cause by listbox.
You can also test a case who total has less than 1000 records, and find out if it cost less memories.

/Joy

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: 2009-12-15 09:17:01 +0800

Seen: 332 times

Last updated: Dec 15 '09

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