Hi, I am not newbie to myfaces/jsf, so maybe it is too simple...
I want to use tree2 as a "navigator", and add deletem,insert commands to it.
for example, if I click a node, and then I click delete, the node get
deleted.
But
1) I can't find way to attach some "command buttons" to a tree2 component. I
mean I want a single delete button to tree2 instead of adding delete button
to each node.
finnally I add them to the parent of the tree2 component( a form) like this
<h:form>
<h:commandLink actionListener="#{mockProjectsToolbarHandler.processAction}"
action="nodeClicked">
<h:outputText value="delete"/>
<t:tree2...
</t:tree2>
</h:form>
I also add a commandLink to each node :
<h:commandLink immediate="true"
styleClass="#{t.nodeSelected ?
'documentSelected':'document'}"
actionListener="#{mockProjectsTreeHandler.processAction}"
action="nodeClicked">
in my mockProjectsTreeHandler, I use
tree.setNodeSelected(event);
to set the current node.
2) I wish I can know which node is the "current node" of tree2,
that is, I click one node, then click the delete button, tree2 will trigger
the event hanlder which I have attached to the delete button, and I wish I
can know which node is just clicked.
I was thinking HtmlTree.getNode() would do this, but it always return null.
I noticed that when I click a node, and the page refreshes, the HtmlTree
object will change, I think that is why the node will be null
3) If I click the "+" of a node, it seems that none of my even handler will
know it.
Please help, thanks!
--
View this message in context:
http://www.nabble.com/Use-a-commandbutton-to-delete-last-clicked-node-of-tree2--tf2304480.html#a6405356
Sent from the MyFaces - Users mailing list archive at Nabble.com.