Logged In: NO

I noticed that there is no problem if we use labels (instead of tree) to select the items. Not sure why there's a problem when tree is used (I need to use trees so using labels is not going to help me but might help in fixing the bug)

<window>
<zscript>
item = null;
</zscript>
<hbox>
<vbox>
Pick item to edit:
<label onClick="selectItem(self)" id="tree1" value="item1" style="color:blue;text-decoration:underline;"/>
<label onClick="selectItem(self)" id="tree2" value="item2" style="color:blue;text-decoration:underline;"/>
</vbox>
<vbox>
<fckeditor id="ed" onChange="updateItemValue(self.value)"/>

<hbox><label value="Item1 value: "/><label id="item1" value="item1 initial
value"/></hbox>
<hbox><label value="Item2 value: "/><label id="item2" value="item2 initial
value"/></hbox>
</vbox>
</hbox>
<zscript>
<![CDATA[
item = item1;

updateItemValue(String newValue)
{
item.value = newValue;
}

selectItem(Component treeitem)
{
//select item to edit
if (treeitem.id.equals("tree1"))
{
//alert("chose item1: " + item1.value);
item = item1;
}
else
{
//alert("chose item2: " + item2.value);
item = item2;
}
//associate the item to the correct editor
//alert("item: " + item.value);
ed.setValue(item.value);
}

selectItem(tree1);
]]>
</zscript>
</window>