Hi

I do have an onSelectionChange() handler but it never gets called when
the root node is clicked. When the root node is clicked i see a visual
change (small change in the background color), but not the real
selection (which defaults to a blue background).

Its only the root element that gives me trouble, when clicking
somewhere on a node below the root it works as expected and my
onSelectionChange() method is called.

And when i talk about a node being clicked, i mean clicking on the
node text (not the expand/collapse images).

Best regards Jens

On Tue, Jun 21, 2011 at 9:51 AM, mkkm...@gmail.com <mkkm...@gmail.com> wrote:
> Yes, it's the end of the code:
>
>  // defining
>   private SingleSelectionModel<MyType> selectionModel =
>     new SingleSelectionModel<MyType>();
>
>   // inside TreeViewModel ctor (or in a better place)
>   selectionModel.addSelectionChangeHandler(new
> SelectionChangeEvent.Handler() {
>
>     public void onSelectionChange(SelectionChangeEvent event) {
>       // fire rpc, a place change or something else
>       // event.getSelectedObject() contains the selected element
>     }
>   });
>
>   // return the DefaultNodeInfo with info about the selection strategy
>   public <T> NodeInfo<?> getNodeInfo(T value) {
>
>     // do something with the value and return the right DefaultNodeInfo
>     if(value instanceof MyType1) {
>       return new DefaultNodeInfo<SectionDTO>(
>           new SectionDataProvider(),
>           new MyCustomCellOrADefaultOne(),
>           selectionModel,
>           null);
>     }
>     else if ...
>   }
>
> Michaël
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-web-toolkit/-/K5UlSlv5YaoJ.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-toolkit+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>

-- 
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-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to