asked
2009-02-27 07:57:18 +0800
evpole 481 ● 2 I have a tree:
<tree model="@{controller.category }" id="tree"
mold="paging" context="treepop">
<treecols>
<treecol label="@{controller.title }" />
</treecols>
</tree>
<menupopup id="treepop"><menuitem label="rename" popup="renamepop"/><menuitem label="add" popup="addpop"/></menupopup>
<popup id="renamepop">enter new name:<textbox id="newname" /><button label="save" id="save1"/></popup>
<popup id="addpop">enter new name:<textbox id="newname" /><button label="save" id="save2"/></popup>
I would like to rename /add a tree node when user right click any node of the tree.
I have seen the demo at :http://www.zkoss.org/smalltalks/zkTreeModel/, it seems have to fire an event like this:
fireEvent(parent,indexFrom,indexTo,TreeDataEvent.INTERVAL_REMOVED);
but class SimpleTreeModel seems don't have this method,and I don't know how to get the "parent" object,it seems to be a ArrayList ,not a Treeitem.but i could only got Treeitem by tree.getSelectedItem().
could anyone please help me ?thanks for any advise!