GWT (lazy) Widget rendering: Comparison of approaches

438 views
Skip to first unread message

Chris Lercher

unread,
May 16, 2012, 10:03:40 AM5/16/12
to google-we...@googlegroups.com
There are several competing (or complemental) new/experimental (or deprecated) classes around, which deal with rendering Widgets in alternative (often lazy) ways in GWT:

- GXT2's lazy Component (which has been deprecated in GXT3)
- PotentialElement ["experimental"]
- IsRenderable ["very experimental"] and RenderablePanel ["experimental"]

Seeing how GXT2 had problems with their lazy rendering, what can we expect from these concepts? Looking into trunk, IsRenderable seems to evolve (using a new RenderableStamper class), so there's probably something in the pipeline...

I know, that this is not a concrete question - I'm just curious if someone has interesting information about this subject?

Δημήτριος Μενούνος

unread,
May 23, 2012, 6:02:07 AM5/23/12
to Google Web Toolkit

Thomas Broyer

unread,
May 23, 2012, 6:57:22 AM5/23/12
to google-we...@googlegroups.com
AFAICT, PotentialElement and IsRenderable are to speed-up rendering of widgets, particularly when used within an HTMLPanel or RenderablePanel in a UiBinder template: the widget is "rendered" to SafeHtml (and stamped), concatenated to the HTML of the containing HTMLPanel and "rendered" as a single big HTML string, then the stamped element is retrieved out of the HTMLPanel and the widget is "attached" to it (claimElement) and finally "logically attached" to the HTMLPanel (as its parent widget).
I suppose they could also be used to attach widgets to some HTML generated (pre-rendered) on the server-side (similar to Closure's decorate(), and the various static wrap() methods used in "basic" GWT widgets; there's no notion of canDecorate() as in Closure though, so it'd be your responsibility to build this into your widgets; not really for reusable widgets, more for applications you control from end-to-end).

Andrea Boscolo

unread,
Jun 22, 2012, 2:11:16 PM6/22/12
to google-we...@googlegroups.com
What about the relation between IsRenderable and the ElementBuilder API?

I know that IsRenderable is used to first render the widget content as safehtml/html, and then attach (claim) the 'real' widget to it. Can the rendering part be deferred to the server (given the lazy nature of RenderablePanel)? Any samples out there of this technique?

The other element I see somehow involved in a possible server-side rendering, is ElementBuilder (http://gwt-code-reviews.appspot.com/1455802). Reading the RFC, it is possible to define even server-side builders (like HtmlDivBuilder) and build an html/safehtml context by chaining calls. But what if I would like to add/remove handlers to a such server-side-generated dom element? Wrap? Maybe is this the IsRenderable purpose?

Server-side widget rendering it's a really interesting topic (mobile development, server-driven UIs, ...), but I can't find any more informations/design docs/samples other than reading all relevant commits/experiment myself.
Reply all
Reply to author
Forward
0 new messages