Sun River
Topics about Java SE, Servlet/JSP, JDBC, MultiThread, UML, Design Pattern, CSS, JavaScript, Maven, JBoss, Tomcat, ...
posts - 78,comments - 0,trackbacks - 0
from : http://www.demay-fr.net:8080/Wicket-start/app

package wicket.contrib.dojo.examples;

import java.util.ArrayList;
import java.util.Iterator;

import wicket.PageParameters;
import wicket.contrib.dojo.html.list.lazy.DojoLazyLoadingListContainer;
import wicket.contrib.dojo.html.list.lazy.DojoLazyLoadingRefreshingView;
import wicket.extensions.markup.html.repeater.refreshing.Item;
import wicket.markup.html.WebPage;
import wicket.markup.html.basic.Label;

public class LazyTableSample extends WebPage {

public LazyTableSample(PageParameters parameters){
DojoLazyLoadingListContainer container = new DojoLazyLoadingListContainer(this, "container", 3000)
DojoLazyLoadingRefreshingView list = new DojoLazyLoadingRefreshingView(container, "table"){

@Override
public Iterator iterator(int first, int count) {
ArrayList<String> list = new ArrayList<String>();
int i = 0;
while(i < count){
list.add("foo" + (first + i++));
}

//fake a busy and slow machine
int j = 0;
while (j < 1000000000){j++;}

return list.iterator();
}

@Override
protected void populateItem(Item item) {
new Label(item, "label",item.getModel());
}

};
}
}

posted on 2008-02-19 13:45 Sun River 阅读(294) 评论(0)  编辑  收藏