PDA

View Full Version : TreeBinder setAutoload() - How to know the load is finished?



francescoNemesi
18 May 2009, 2:37 AM
Hello,

I am using 1.2.4. I have a binder with setAutoload(true) and the usual async tree implementation with loader/proxy/store/binder/tree. The binder loads several children with children. I would like to know how to detect the fact that the the load has finished COMPLETELY for ALL items to be displayed in the tree. I have added the following listener to the loader



loader.addLoadListener(new LoadListener() {
@Override
public void loaderLoad(LoadEvent le) {
super.loaderLoad(le);
System.out.println("\n\n!!! TREE LOAD COMPLETE !!!\n");
}
});


But that's no good as loaderLoad is executed for every item, not just the last one.

Any ideas? Thanks for any help...

Francesco

takayser
15 Jan 2010, 2:10 AM
I have the same issue, did you solved it?

takayser
26 Jan 2010, 2:52 AM
Use this LoadListener if there are no asynchronous calls like DeferredCommand, RPC Calls and so on in cycles. I used it to show up a tree not before loader is completely loaded.


/**
* Use this LoadListener if there are no asynchronous calls like
* DeferredCommand, RPC Calls and so on in cycles.
*
* @since 26.01.2010
* @author takayser
*/
public class SynchronousLoadListener extends LoadListener {
DelayedTask task = new DelayedTask(new Listener<BaseEvent>() {
public void handleEvent(BaseEvent be) {
loaderFinished();
}
});

@Override
public void loaderBeforeLoad(LoadEvent le) {
task.cancel();
}

@Override
public void loaderLoad(LoadEvent le) {
task.delay(1);
}

/**
* Fires if load is completely done.
*/
protected void loaderFinished() {

}
}

jennyangelos2
26 Jan 2010, 3:36 AM
condo foreclosures phoenix (http://condo-foreclosures-phoenix.homes-1.info) - home foreclosures in phoenix (http://home-foreclosures-in-phoenix.homes-1.info) - phoenix bank foreclosures homes (http://phoenix-bank-foreclosures.homes-1.info)