CellTree with different types at same level

250 views
Skip to first unread message

decitrig

unread,
Nov 16, 2010, 6:47:56 PM11/16/10
to Google Web Toolkit
The docs for CellTree say that nodes at the same level "usually" share
a common type, but that it isn't necessary. However, since the data
providers & node info are parameterized, nodes seem to *have* to have
a common type at a given level. What am I missing? are there examples
anywhere of having types with nothing in common at the same level? Is
it just returning a raw NodeInfo and then doing the type checking/
casting in the cell?

David Pinn

unread,
Nov 16, 2010, 8:41:49 PM11/16/10
to Google Web Toolkit
I think type checking and casting within the cell is necessary in that
case.

John LaBanca

unread,
Nov 17, 2010, 8:18:36 AM11/17/10
to google-we...@googlegroups.com
By "at the same level", we mean that if A and B are siblings, their children can be different types even if there are at the same depth in the tree.  CellTree doesn't support difference types within the same child list.  You'll have to use a common super type or interface and cast as needed.

The following is supported.  The children of A and B are different types (Bar and Baz) but are both one level deep:
A (Foo)
- AA (Bar)
- AB (Bar)
- AA (Bar)
B (Foo)
- BA (Baz)
- BB (Baz)
- BC (Baz)

The following is not supported.  The children of A cannot be of multiple types.
A (Foo)
- AA (Bar)
- AB (Baz)
- AA (Biz)

Thanks,
John LaBanca
jlab...@google.com


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.


ayushi...@gmail.com

unread,
Nov 18, 2015, 3:58:56 AM11/18/15
to GWT Users, jlab...@google.com
Hi john

I have a query, what if we want the level one too have different type and same with sub level.
John LaBanca
jlab...@google.com


To unsubscribe from this group, send email to google-web-toolkit+unsub...@googlegroups.com.

CodeLess Solutions

unread,
Nov 18, 2015, 10:35:47 AM11/18/15
to GWT Users, jlab...@google.com
Make sure that all your classes extend the same base class and you will be fine as John already said.
Reply all
Reply to author
Forward
0 new messages