found the solution.First Need to add child then need to set state
true.
private Tree createTree() {
// Create a Tree
TreeItem root = new TreeItem("root");
root.addItem("item0");
root.addItem("item1");
root.addItem("item2");
TreeItem childwithsubchilder = new TreeItem("subitmes");
childwithsubchilder.addItem("item0");
childwithsubchilder.addItem("item1");
childwithsubchilder.addItem("item2");
root.addItem(childwithsubchilder);
// expand the element
root.setState(true);
Tree t = new Tree();
t.addItem(root);
return t;
}
On Sep 7, 12:56 pm, Sanjay Jain India <[email protected]> wrote:
> I a using GWT 2.3.In which I am using import
> com.google.gwt.user.client.ui.Tree. I want to show tree expanded
> always.For that I did below code for every tree item
>
> treeItem.setState(true);
>
> But it is not working.I am not getting how to expand tree. Please help
> me out.Thanks in advance
--
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.