Hi All,

I am using gwt 1.6.4 and when i listened about it's LazyPanel widget
then one thought was coming in my mind i.e. if i use in my widgets
then can some effect on performance of widget loading.

But when i checked it's example then i found if i follow some good
practices in my code i.e. not make any unnecessary objects then it
behaves same like as and then there should be no major differences
according to performance.

Just i want to know what is the  difference in between :-

Given in GWT Example :-


public class LazyPanelExample implements EntryPoint {

  private static class HelloLazyPanel extends LazyPanel {
    @Override
    protected Widget createWidget() {
      return new Label("Well hello there!");
    }
  }

  public void onModuleLoad() {
    final Widget lazy = new HelloLazyPanel();
    lazy.setVisible(false);
    PushButton b = new PushButton("Click me");
    b.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        lazy.setVisible(true);
      }
    });

    RootPanel root = RootPanel.get();
    root.add(b);
    root.add(lazy);
  }
}


And what am i thinking :-

public class AlternativeLazyPanelExample implements EntryPoint {

 public void onModuleLoad() {
    HorizontalPanel hp = new HorizontalPanel();
    PushButton b = new PushButton("Click me");
    b.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
hp.clear();
Label label = new Label("Well hello there!");
hp.add(label);
      }
    });

    RootPanel root = RootPanel.get();
    root.add(b);
    root.add(hp);
  }
}



And as the differences what i am thinking there is major difference
i.e. in my case everytime these lines will execute :-

hp.clear();
Label label = new Label("Well hello there!");
hp.add(label);


But object creation is same.

And any major differences i.e. is lazyPanel help me for increasing the
loading time of widgets.


Thanks and regards,

Sanj
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to