-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
I have more than 5 list boxes (mold="select") in my main page. When i login, it takes more time to display the main page.
It loads all the listboxes and then displays the main page.
I need, the other components has to be displayed and bind the data after that. i.e. displays the static components first
and then load the listboxes.
Any idea?
If you use (@)databinding you could controll the databinder and load by "scope".
/Robert
Here is my demoside - check the SimpleComposer6 demo.
In this demo i create an own scope for input - this saves only this components.
My last improvment:
- i do not use the <?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="simpleWindow"?>
--> this way, i can avoid the first "full load"
instead of <init and catching the databinder (like in the SimpleComposer6 demo), i create my own databinder.
public class SimpleComposer7 extends GenericForwardComposer { private AnnotateDataBinder binder; ... @Override public void doAfterCompose(Component win) throws Exception { super.doAfterCompose(win); // create an own databinder instance --> no <?init class...> line!! binder = new AnnotateDataBinder(win); binder.bindBean("controller", this); // bind this controller to the databinder binder.loadAll(); // load all OR binder.loadComponent(xy); ...
instead of binder.loadAll() you can use:
binder.loadComponent(xy);
xy your "root" component from you scope.
here an example:
doAfterCompose(...)
binder.loadComponent(input);
// --> init your search area
..
public void onClick$search() {
binder.saveCompoment(input); // Save and check the inputdata
...
binder.loadComponent(list);
}
<grid id="input">
....input/search fields
<button id="search"/>
</grid>
..
<listbox id="list">
..result fields
</listbox>
Asked: 2010-12-29 00:08:12 +0800
Seen: 684 times
Last updated: Jan 13 '11