0

about paging of listbox

asked 2009-11-23 23:48:27 +0800

yuzexu_zk gravatar image yuzexu_zk
240 2

how to set Paging component to the listbox paging position

use my new Paging replace the listbox default paging component

delete flag offensive retag edit

6 Replies

Sort by ยป oldest newest

answered 2009-11-24 04:57:32 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

You can set the your paging component on Top or Bottom of the listbox.

Sample for paging component on Bottom.

		<div>
			<listbox id="listBoxId" vflex="true" width="99.5%"
				height="100%" multiple="false">
				<listhead sizable="true">
					<listheader id="listheader_Branch_Description"
						image="/images/icons/sequence.gif"
						label="${c:l('listheader_Branch_Description.label')}" sort="auto"
						width="70%" />
					<listheader id="listheader_Branch_No"
						image="/images/icons/builder.gif"
						label="${c:l('listheader_Branch_No.label')}" sort="auto"
						width="30%" />
				</listhead>
				<listitem label="item1" />
				<listitem label="item2" />
				<listitem label="item3" />
				<listitem label="item4" />
				<listitem label="item5" />
				<listitem label="item6" />
				<listitem label="item7" />
			</listbox>

			<paging id="pagingId" pageSize="5" totalSize="100"
				detailed="true" />
		</div>

best
Stephan

link publish delete flag offensive edit

answered 2009-11-24 06:57:19 +0800

yuzexu_zk gravatar image yuzexu_zk
240 2

sorry my mean is i do't want to write paging component in page

i try to override the getPagingChild() method

for example:
class MyListbox extends Listbox
{


private Paging _paging;

public MyListbox()
{
_paging = new Paging();
_paging.setTotalSize(10000);
}
public Paging getPagingChild()
{

return _paging;
}
}
my paging component is add to the listbox paging position but the paging component can't paging

link publish delete flag offensive edit

answered 2009-11-24 06:58:21 +0800

yuzexu_zk gravatar image yuzexu_zk
240 2

sorry my mean is i do't want to write paging component in page

i try to override the getPagingChild() method

for example:
class MyListbox extends Listbox
{


private Paging _paging;

public MyListbox()
{
_paging = new Paging();
_paging.setTotalSize(10000);
}
public Paging getPagingChild()
{

return _paging;
}
}
my paging component is add to the listbox paging position but the paging component can't paging

link publish delete flag offensive edit

answered 2009-11-24 09:25:00 +0800

yuzexu_zk gravatar image yuzexu_zk
240 2

the problem is solve
1. add lang-addon.xml
<component>
<component-name>slistbox</component-name>
<component-class>com.xxx.common.component.PagingListbox</component-class>
<mold>
<mold-name>default</mold-name>
<mold-uri>~./zul/html/listbox-pg.dsp</mold-uri>
</mold>
</component>
2.PagingListbox.java
class PagingListbox
{
private Paging _paging;
//override the method
public void beforeChildAdded(Component newChild ,Component refChild)
{
if(newChild instanceof Paging)
return;
super.beforeChildAdded(newChild, refChild);
}
public void onCreate()
{
initPaging();
}

private void initPaging()
{
if("paging".equals(this.mold))
{
_paging = new Paging();
_paging.setPageSize(pageSize);
_paging.setDetailed(true);
_paging.setParent(this);
_paging.addEventListener(ZulEvents.ON_PAGING, new EventListener(){

public void onEvent(Event evt) throws Exception
{
refreshModel();
}
});
}
}

}
3.listbox.zul

<window>
<slistbox id="sl" mold="paging" pageSize="10">
</slistbox>
</window>

hope this can help other developer

link publish delete flag offensive edit

answered 2009-12-11 19:00:00 +0800

sugonibro gravatar image sugonibro
72 2
http://www.keep-a-breast....

can someone give me a sample using paging in MYsql database. I am a newbie

link publish delete flag offensive edit

answered 2009-12-13 18:57:39 +0800

henrichen gravatar image henrichen
3869 2
ZK Team

http://docs.zkoss.org/wiki/Handling_huge_data_using_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-11-23 23:48:27 +0800

Seen: 511 times

Last updated: Dec 13 '09

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