New article on using Cell Widgets for every day GWT development

128 views
Skip to first unread message

dparish

unread,
Dec 11, 2013, 4:00:14 PM12/11/13
to google-we...@googlegroups.com

Google Web Toolkit provides Cell Widgets as a way to write web pages that render large volumes of data quickly. This is a primer on using Cell Widgets for everything, not just when there is lots of data.  The payoff is a faster app that is often easier to write.



If you have any questions or suggestions for improvement I'd love to hear it.


Juan Pablo Gardella

unread,
Dec 11, 2013, 4:38:56 PM12/11/13
to google-we...@googlegroups.com
Thanks for sharing David!


2013/12/11 dparish <dpa...@gmail.com>

Google Web Toolkit provides Cell Widgets as a way to write web pages that render large volumes of data quickly. This is a primer on using Cell Widgets for everything, not just when there is lots of data.  The payoff is a faster app that is often easier to write.



If you have any questions or suggestions for improvement I'd love to hear it.


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-tool...@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

David

unread,
Dec 12, 2013, 7:46:44 AM12/12/13
to google-we...@googlegroups.com
Hi,
 
Interesting read, I did not realize there was a CellWidget.
 
Is there an advantage to use CellWidget instead of using UiBinder as a Widget straight away ?
Ok, you could easily reuse the Cell in another cell widget (List/Table/Tree).
 
David

David Parish

unread,
Dec 13, 2013, 2:30:22 PM12/13/13
to google-we...@googlegroups.com
The main advantage to me is that you are writing high performance widgets as a standard practice.  There are far fewer javascript calls to create these types of widgets. As your app gets larger it will continue to stay performant.  


You received this message because you are subscribed to a topic in the Google Groups "Google Web Toolkit" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/1g-Fkt_jWUs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-web-tool...@googlegroups.com.

Jens

unread,
Dec 14, 2013, 7:53:03 AM12/14/13
to google-we...@googlegroups.com
The main advantage to me is that you are writing high performance widgets as a standard practice.  There are far fewer javascript calls to create these types of widgets. As your app gets larger it will continue to stay performant. 

I actually believe that you do not get that much of a performance benefit by using CellWidget unless someone proves the opposite and provides some decent benchmarking results. Here are my reasons:

1.) CellWidget extends Widget so you get the same Widget based overhead like with traditional widgets (e.g. set up widget event system)
2.) What makes CellTable/DataGrid/CellList really fast is that they are able to create one very large string of HTML code via Cell rendering and then call container.setInnerHTML(largeString) once. 
However with lots of CellWidgets you have lots of setInnerHTML calls and the HTML string for those CellWidgets is typically a lot smaller then what CellTable/DataGrid/CellList produce. For such a small HTML string I believe that setInnerHTML does not perform significant faster than a couple of DOM operations, especially if you are using UiBinder for your traditional Widget and using HTMLPanel as root widget so you can use as much HTML as possible inside UiBinder.
3.) A CellWidget needs to redraw itself every time its associated data changes. So you end up with even more setInnerHTML calls.

IMHO it's probably only worth it to use CellWidget if you need to support IE6/7 because its DOM performance is so bad. IE8 works kind of ok'ish if you don't add too many widgets at once but will probably also benefit from CellWidgets. Well and if you are lucky and must only support IE 9+ then CellWidget will definitely loose its value.

So please prove me wrong for IE 9+ browsers :)


Anyways what I like about the article is that it shows a compact example on how to use UiBinder + UiRenderer for writing cells (maybe adding one event handler for demonstration would have been a nice addition) and that you can re-use that cell in a widget context if you need to.


-- J.


jaga

unread,
Dec 14, 2013, 3:31:33 PM12/14/13
to google-we...@googlegroups.com
Hi, admittedly I haven't studied the article but still wanted to comment on something I noticed. The use of tables for screen layout is not best practise. It is far better to use divs (FlowPanel) and CSS.

Jaga

Reply all
Reply to author
Forward
0 new messages