Hi meandi,
I couldn't reproduce the issue you described using the code snippet you
provided (along with the setDefault() method implementation below.

private void setDefaults(){
  // Building the tree ...
  TreeItem root = new TreeItem("root");
  root.addItem("item0");
  root.addItem("item1");
  root.addItem("item2");

  TreeItem moreItems = new TreeItem("moreitems");
  moreItems.addItem("moreitems1");
  moreItems.addItem("moreitems2");
  moreItems.addItem("moreitems3");

  root.addItem(moreItems);
  tree.addItem(root);
}

Could you provide more details about which browser you were using when you
encountered this issue? As well as which type of widgets you were adding to
the Tree when the double-fire error occurred?

Cheers,
-Sumit Chandel

On Fri, May 8, 2009 at 3:12 AM, meandi <[email protected]> wrote:

>
> Hi,
>
> I defined an SelectionHandler to my tree, that will call a method of
> my controller when the user clicks on a leaf. This part works fine. If
> the user clicks on a node (with childs) the branch state (of folding)
> should be changed.There encounters a problem: Clicking/Selecting a
> leaf fires the event once, clicking on a folded (state false) node
> fires the event once too. But if the branch is unfolded (state true)
> the event is fired twice.
> Is it an error in reasoning or does it still referres to the bug that
> was fixed in Version 1.1.0?
>
> I'm working with GWT Version 1.6.4
>
> sourcecode looks like this:
>
> public class NavigationView extends Composite implements
> SelectionHandler<TreeItem> {
>
>
>        Panel panel = new VerticalPanel();
>        Tree tree = new Tree();
>                Navigation controller = new NavigationController();
>
>        public NavigationView(){
>                setDefaults();
>                panel.add(tree);
>                tree.addSelectionHandler(this);
>                initWidget(panel);
>        }
>
>        private void setDefaults(){
>                // Building the tree ...
>        }
>
>        public void onSelection(SelectionEvent<TreeItem> event) {
>                TreeItem item = event.getSelectedItem();
>
>                if(item.getChildCount() == 0) {
>                        Window.alert(item.getText());
>                        //controller.selectionChanged(item);
>                }
>                else {
>                        item.setState(!item.getState());
>                }
>        }
> }
>
> >
>

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

Reply via email to