-
FEATURED COMPONENTS
First time here? Check out the FAQ!
how to set Paging component to the listbox paging position
use my new Paging replace the listbox default paging component
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
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
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
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
can someone give me a sample using paging in MYsql database. I am a newbie
Asked: 2009-11-23 23:48:27 +0800
Seen: 511 times
Last updated: Dec 13 '09