views:

52

answers:

1

I'm really struggling with a choice between the GWT Tree widget, which has been a part of GWT for ages; or the new CellTree, which is introduced by GWT 2.1.

The tree I want to present to the user is not particularly large, but I am very concerned about responsiveness.

The data at the nodes of the tree will be editable. By clicking on a node, the user will put the node into edit mode. Editing the more simple nodes will require only a single TextBox or TextArea; but others will involve several widgets, over which I want styling control via CSS.

I'm attracted to the CellTree approach because it seems to offer great flexibility and speed; however, the sample code for CellTree editing deals with only very simple data types: string, date, integer, etc. I don't know if CellTree is appropriate when you've got more complex node-editing needs.

What do you think? Is CellTree the best approach? Does CellTree replace Tree in general? What heuristics can I apply in choosing between them?

+1  A: 

I'm using a CellTable with several custom input Cells, including one comprised of many widgets. It works great!

It took me a couple of hours to understand how to implement a custom Cell that could do complex operations - since a single instance of the Cell will flit around the CellTree, pretending to be many instances, you need to understand how it's getting its data and when it is refreshed and rendered. I learned a lot from the source of the DatePickerCell.

I can't speak for CellTree, but the CellTable is very flexible, was easy to program, and saves me hundreds of Widget instances.

Riley
Did you make use of CompositeCell for the cell with multiple widgets?
David
I extended the AbstractEditableCell class. I started using it in 2.1.0.M3, before they had many docs, so it could be that CompositeCell is what you want. I also see they added "Editor"s, which look neat.
Riley