CellTree with SingleSelectionModel will not fire event for root node (GWT 2.3)

482 views
Skip to first unread message

Jens

unread,
Jun 14, 2011, 10:01:29 AM6/14/11
to Google Web Toolkit
Hi

I have a CellTree with a SingleSelectionModel, when i click the root
node it gets visually selected but does not fire a
SelectionChangeEvent, the problem is only for the root element.

Has anyone else discovered (is it by design / a bug / me that screwed
up).

My example is quite simple but i cannot post the code as is, but i can
clean it up and post it if required.

Best regards Jens

Jens Teglhus Møller

unread,
Jun 17, 2011, 1:15:33 PM6/17/11
to Google Web Toolkit
Anyone? I'm trying to create an 'windows explorer' like interface with
a CellTree on the left and a CellTable on the right (so when i click
on a node in the tree i get the details in the table). It works nicely
except that i can not click the root node. Its a bit of a showstopper.

Best regards Jens

> --
> 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.
>
>

mkk...@gmail.com

unread,
Jun 19, 2011, 9:40:05 AM6/19/11
to google-we...@googlegroups.com

Jens

unread,
Jun 21, 2011, 2:30:38 AM6/21/11
to Google Web Toolkit
Hi

Thanks for the tip, but my problem is not loading the nodes, its only
selection the root node that causes me problems (or did i miss
something in the mentioned thread?).

Best regards Jens

On Jun 19, 3:40 pm, "mkkm...@gmail.com" <mkkm...@gmail.com> wrote:
> Hi,
>
> Try
> here:https://groups.google.com/forum/?start&hl=en#!searchin/google-web-too...
>
> Michaël

mkk...@gmail.com

unread,
Jun 21, 2011, 3:51:16 AM6/21/11
to google-we...@googlegroups.com
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
Reply all
Reply to author
Forward
0 new messages