0

Fixed layout in listbox?

asked 2009-01-23 16:49:04 +0800

sudamar gravatar image sudamar
15

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?

delete flag offensive retag edit

3 Replies

Sort by » oldest newest

answered 2009-01-23 17:32:32 +0800

mjablonski gravatar image mjablonski
1284 3 5
http://www.jease.org/

updated 2009-01-23 17:34:43 +0800

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>

link publish delete flag offensive edit

answered 2009-01-23 20:14:05 +0800

sudamar gravatar image sudamar
15

It Doesnt work... :(

Actually, I need of the one that show 10 lines fixed, however in the collection has 8 or 7 itens...

Anyone?

link publish delete flag offensive edit

answered 2009-01-24 17:41:14 +0800

windperson gravatar image windperson
415 1

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>

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-01-23 16:49:04 +0800

Seen: 449 times

Last updated: Jan 24 '09

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