LazyPanel and lazy loading

217 views
Skip to first unread message

Steve C

unread,
Dec 7, 2011, 7:12:18 PM12/7/11
to Google Web Toolkit
I believe that LazyPanel in and of itself does not perform lazy
loading - that I would still need to use GWT.runAsync to achieve lazy
loading. Is this the case?

And, if so, does LazyPanel provide any benefit for lazy loading with
runAsync?

-sowdri-

unread,
Dec 8, 2011, 2:39:17 AM12/8/11
to google-we...@googlegroups.com
LazyPanel and runAsync() are for different purpose. 

LazyPanel is just a container for lazy-initialization of widgets. As the widget creation involves dom manipulation, which is relatively costly, you could use LazyPanel to defer it, in case you have a really complex widget. 

runAsync, is used for code splitting, ie to introduce split points. If you look at the simple example with just creation of widget inside the runAsync block, it may look like a better version of LazyPanel, but its not.

-sowdri- 

Steve C

unread,
Dec 8, 2011, 10:17:58 AM12/8/11
to Google Web Toolkit
Thanks, I thought that was the case, especially from looking at the
code in LazyPanel.java, but the first line of the Javadoc for
LazyPanel is a little misleading:

"Convenience class to help lazy loading."

Steve

On Dec 8, 2:39 am, -sowdri- <sow...@gmail.com> wrote:
> LazyPanel and runAsync() are for different purpose.
>

> LazyPanel is just a container for lazy-*initialization *of widgets. As the

Ed

unread,
Dec 8, 2011, 2:17:52 PM12/8/11
to Google Web Toolkit
Have a look at this topic:
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/3cc28ae54f8ba979
It describes SimpleWidget that makes any Widget very lazy, just
subclass it.

- Ed

Reply all
Reply to author
Forward
0 new messages