0

Load listbox after page displayed

asked 2010-12-29 00:08:12 +0800

asgar gravatar image asgar
132 1 3

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?

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2010-12-29 08:28:10 +0800

robertpic71 gravatar image robertpic71
1275 1

If you use (@)databinding you could controll the databinder and load by "scope".

/Robert

link publish delete flag offensive edit

answered 2011-01-13 16:16:45 +0800

billson gravatar image billson
18 1

robertpic71, pls provide more guide for this solution by control the databinder and load by scope that u refering. tks.

link publish delete flag offensive edit

answered 2011-01-13 21:54:25 +0800

robertpic71 gravatar image robertpic71
1275 1

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>

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2010-12-29 00:08:12 +0800

Seen: 684 times

Last updated: Jan 13 '11

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More