sagipolley
03-26-2005, 11:26 AM
Hi all,
I have a method that (among other things) adds a new tree as a child of the selected item of an existing tree. (This is to get around the fact that a tree will not update if you change the data that it represents.)
When the selected item is a leaf (isleaf=true), all works OK. When the selected item is NOT a leaf, the whole app locks up.
The tree class's onselected method writes this.datapath.p to Debug. When trying to add a tree to a non-leaf node, what is written to Debug alternates between "undefined" and the datapath of the selected node.
My tree class is defined as follows:
<class name="innertree" extends="tree" isleaf="$path{'@isleaf'}" open="true" icon="null">
<method event="onselected">
<![CDATA[
// super.onselected();
Debug.write('this.datapath.p:');
Debug.write(this.datapath.p);
actionpane.datapath.setPointer( this.datapath.p );
treeselection=this.getSelection();
treeselected=treeselection.text;
]]>
</method>
<method event="onclick">
<![CDATA[
// super.onclick();
actionview.setVisible(true);
treeselection=this.getSelection();
treeselected=treeselection.text;
Debug.write('treeselected =', treeselected);
]]>
</method>
</class>
Any idea what's going on here? Do I need to actually insert two trees, one within the other?
TIA,
Martin
I have a method that (among other things) adds a new tree as a child of the selected item of an existing tree. (This is to get around the fact that a tree will not update if you change the data that it represents.)
When the selected item is a leaf (isleaf=true), all works OK. When the selected item is NOT a leaf, the whole app locks up.
The tree class's onselected method writes this.datapath.p to Debug. When trying to add a tree to a non-leaf node, what is written to Debug alternates between "undefined" and the datapath of the selected node.
My tree class is defined as follows:
<class name="innertree" extends="tree" isleaf="$path{'@isleaf'}" open="true" icon="null">
<method event="onselected">
<![CDATA[
// super.onselected();
Debug.write('this.datapath.p:');
Debug.write(this.datapath.p);
actionpane.datapath.setPointer( this.datapath.p );
treeselection=this.getSelection();
treeselected=treeselection.text;
]]>
</method>
<method event="onclick">
<![CDATA[
// super.onclick();
actionview.setVisible(true);
treeselection=this.getSelection();
treeselected=treeselection.text;
Debug.write('treeselected =', treeselected);
]]>
</method>
</class>
Any idea what's going on here? Do I need to actually insert two trees, one within the other?
TIA,
Martin