-
FEATURED COMPONENTS
First time here? Check out the FAQ!
As tutorial (http://www.zkoss.org/zkdemo/userguide/#g7) I creted a cool listbox (incremented with live). But I need fix a amount lines in listbox. eg: my data has 5 lines (itens) but I want to fix, in the screen, 10 lines!!!
This is because doesn´t muss my layout!!!
How do I do?
rows/setRows should do the trick... here's an modified example taken from ZKDemo:
HTH, Maik
<zk> <zscript> List items = new org.zkoss.zkdemo.userguide.BigList(24); //a big list of Integer </zscript> <listbox id="listbox" mold="paging" rows="10" pageSize="10"> <listitem forEach="${items}"> <listcell label="${each}-1"/> <listcell label="${each}-2"/> <listcell label="${each}-3"/> <listcell label="${each}-4"/> </listitem> </listbox> </zk>
Hi sudamar,
You can use rows attribute of <listbox> to set the fix list size of listbox, for example:
<zk> <zscript> String[] data = new String[8]; for(int j=0; j < data.length; ++j) { data = "option "+j; } ListModel strset = new SimpleListModel(data); </zscript> <listbox id="list" width="200px" rows="10" model="${strset}"> <listhead> <listheader label="Load on Demend" sort="auto"/> </listhead> </listbox> </zk>
Asked: 2009-01-23 16:49:04 +0800
Seen: 449 times
Last updated: Jan 24 '09