-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi ,
I have been trying to implement Render on demand functionality on listbox. I added this listner to my class :
public class LazyListbox extends Listbox {
.
.
public void initialize() {
addEventListener("onDataLoading", new EventListener() {
public void onEvent(Event event) throws Exception {
DataLoadingEvent dataLoadingEvent = (DataLoadingEvent) event;
int offset = dataLoadingEvent.getOffset();
int limit = dataLoadingEvent.getLimit();
ListModel origModel = LazyListbox.this.getModel();
if (origModel instanceof RenderOnDemandListModel<?>) {
RenderOnDemandListModel<?> model = (RenderOnDemandListModel<?>) origModel ;
model.loadCache(offset + 1, offset + limit);
}
}
});
}
.
.
.
}
Every thing is working fine. and I was able to successfully implement this functionality.
Now the only problem I face is that after a certain list size(around 11,18,480) ,this event stops getting called. So when I Scroll down nothing happens. I think the Component(listbox in this case) is not able to send the AUrequest to server. I still don't know the reason why. If somebody is able to identify and have a solution for this please reply.
Thanks in advance.
@jimmyshiau : As you are here can you help me in one more scenerio : I am using this event "onDataLoading" ,so when user scrolls down the list ,it fetches the next items and renders them to ui. but user eventually in process of scrolling down ,causes multiple scroll down events, so two time this "onDataLoading" event is called(it can be more than two depends on number of time user scrolled down on unrendered list) . This slows down the functionality. I just want to have the last scroll(latest offset values) to work.
and thanxx for your help. :)
Asked: 2014-10-13 08:07:27 +0800
Seen: 28 times
Last updated: Oct 16 '14
wrong valueException come in front of modal popup [closed]
Listcell: load style color on @bind record
limit when implement zAu.ajaxErrorHandler
Use parameters in a conditional @command
Problems with multiple press and onCtrlKey
MVVM @save on the fly [closed]
Unable to activate destroyed desktop
org.zkoss.zk.ui.UiException: java.lang.ClassNotFoundException
in zk javacsript : ebody.scrollheight(listbox-body scroll height) becomes negative after 1118480 size. why?if anybody knows.
nsharma ( 2014-10-14 10:33:03 +0800 )editIt stops working exactly after list size becomes greater than 1118480.
nsharma ( 2014-10-14 11:02:54 +0800 )editWhat browser are you using?
jimmyshiau ( 2014-10-15 02:23:29 +0800 )editI am using google chrome and yess in internet explorer it is working fine, But my application is browser independent,so they can use any of it. moreover it doesn't sound good to have these many items in one page, of course now i have managed to pull only 300 item at one time. It is just one scenerio
nsharma ( 2014-10-16 13:22:47 +0800 )edit