From c4bfaa779cee24084cb9b56a3da788e5cab71e85 Mon Sep 17 00:00:00 2001 From: Joonas Lehtinen Date: Wed, 13 Jun 2007 14:00:44 +0000 Subject: Now tree expansion works svn changeset:1701/svn branch:trunk --- src/com/itmill/toolkit/terminal/gwt/client/ui/TkTree.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/TkTree.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/TkTree.java index 3585bc88ee..55476b94b6 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/TkTree.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/TkTree.java @@ -42,8 +42,8 @@ public class TkTree extends Composite implements Paintable { tree.addItem(childUidl.getStringAttribute("caption")); if(childUidl.getTag().equals("node")) { TreeNode childTree = new TreeNode(); - childTree.updateFromUIDL(childUidl, client); tree.addItem(childTree); + childTree.updateFromUIDL(childUidl, client); } } String selectMode = uidl.getStringAttribute("selectmode"); @@ -82,10 +82,11 @@ public class TkTree extends Composite implements Paintable { for (Iterator i = uidl.getChildIterator(); i.hasNext();) { UIDL childUidl = (UIDL)i.next(); TreeNode childTree = new TreeNode(); - childTree.updateFromUIDL(childUidl, client); this.addItem(childTree); + childTree.updateFromUIDL(childUidl, client); } - // TODO if(uidl.getBooleanAttribute("expanded")) setState(true); + setState(uidl.getBooleanAttribute("expanded")); + setSelected(uidl.getBooleanAttribute("selected")); } -- cgit v1.2.3