I watched a Google I/O video on GWT performance that recommended using Cell Widgets as much as possible because they are faster and lighter-weight than normal Widgets.
I am trying to determine if I should use either:
com.google.gwt.user.client.ui.Button(Button Widget); orcom.google.gwt.cell.client.ButtonCell(Cell Widget)
I have read somewhat conflicting literature on widgets and cells; some authors say to only use cells when you don’t have any events that need to be responded to.
So I ask: is it true that cell widgets don’t have handlers and can’t respond to events? If so, what’s the use of a ButtonCell that will surely be clicked! And if it’s not true, then it kind of seems like cell widgets are a total replacement for the “old” widget framework – is that true, or are there still use cases for Button and its other “old” widget kindred?
Strictly speaking, ButtonCell is not a “cell widget”, it’s a “cell”, which is used by cell widget like CellList or CellTable to render it’s content.
Cell widgets used for displaying large amount of similar-structured data (lists/tables), and for rendering a particular “cell” in such tables – you should use these lightweight stateless widgets (ButtonCell, TextCell). The benefits come from less amount of resulting dom-elements and JS. Also, CellWidgets still can receive browser events, but you should specify it explicitly. More on this topic – see official Google’s guide.
If you do not use cell widgets – you don’t need to use cells, for example if you want to make a user-input form and put some labels and buttons – use Label and Button widgets, if you need to show a list of >100 rows – you might want to use TextCell and ButtonCell within CellList widget.