CellTree and SelectionModel

491 views
Skip to first unread message

tom

unread,
Aug 10, 2011, 11:46:55 AM8/10/11
to Google Web Toolkit
Hello,

I'm working on an app with a cell tree. I've found out that in order
to react to select events, I've got to include my SelectionModel in
the NodeInfo my TreeViewModel returns in getNodeInfo().

Now my tree has layers which contain both leafs and branches, but only
the leaf nodes must be selectable.

Is there a way to insert a different SelectionModel for the leaves
than for the branches?

Regards,

Tom

Peter Nøbbe

unread,
Aug 11, 2011, 3:47:44 AM8/11/11
to google-we...@googlegroups.com
Hi  mate...

Take a look on this..


This will help you get to the leafs en a mulit layed tree.

Basicly what you need to do is just create a selection model and parse it into the node...


tom

unread,
Aug 11, 2011, 9:10:13 AM8/11/11
to Google Web Toolkit
Hi,

thanks for the link, but I think the example is a different case. In
the example tree, they apply the selectionModel only for the 'Song'
layer, which never contains anything but leaf nodes.

In my case, there's layers with both leaf- and subtree nodes. Like in
a filesystem tree, where there's both files and subdirectories on the
same level.

When simply applying a SingleSelectionModel to any kind of node, I get
weird behaviour upon selection (multiple tree nodes get selected, each
on every expanded tree layer).


On 11 Aug., 09:47, Peter Nøbbe <akpe...@gmail.com> wrote:
> Hi  mate...
>
> Take a look on this..
>
> http://www.google.com/codesearch/p?hl=en#A1edwVHBClQ/user/javadoc/com...

Mamadou Bobo Diallo

unread,
Aug 11, 2011, 1:40:22 PM8/11/11
to Google Web Toolkit
Hi There.
I got the same issue. But haven't found a way to fix this.

I would rather prefere to be able to select only leaf node.

tom

unread,
Aug 12, 2011, 9:40:17 AM8/12/11
to google-we...@googlegroups.com

Hi,

As a workaround, I've implemented onBrowserEvent() in the Cells I use to display my data.

Like here: https://groups.google.com/d/topic/google-web-toolkit/mWdBS9kavuc/discussion

Still interested in a clean solution via SelectionModel.

tom

unread,
Aug 17, 2011, 10:11:52 AM8/17/11
to Google Web Toolkit
Now got it working with SingleSelectionModel. The first time I tried
it, the SingleSelectionModel wasn't working properly because it lacked
a ProvidesKey to distinguish my EntityProxies.

On 12 Aug., 15:40, tom <majortom...@gmail.com> wrote:
> Hi,
>
> As a workaround, I've implemented onBrowserEvent() in the Cells I use to
> display my data.
>
> Like here:https://groups.google.com/d/topic/google-web-toolkit/mWdBS9kavuc/disc...
Reply all
Reply to author
Forward
0 new messages