Simon, I have no problems to generate an event from a node commandLink. I should be able even to get at the selection by means of getRowData (from a Ric Smith blog). I just wonder why SelectionEvents are never generated. I couldn't even find any "new SelectionEvent" through sources, while RowDisclosureEvents appear to be handled properly.
And even worse, I wonder about those many model errors after committing onclick (I'm going to inspect them though).


Simon Lessard wrote:
Hello Renzo,

Did you try to use Trinidad's setActionListener? I did not try with tree but
I was able to handle most selection with it before. You can try something

<tr:tree value="#{myTreeBean.model}" var="node">
 <f:facet name="nodeStamp">
   <tr:commandLink action="something">
     <tr:image source="#{node.image}"/>
     <tr:outputText value="#{node.description}"/>
     <tr:setActionListener from="#{node}" to=#{myTreeBean.selectedNode} />

Again, I did not try it with tr:tree though so it might not work, but I
think it worth a try.


~ Simon

On 1/8/07, Renzo Tomaselli <> wrote:

 Hi, while using a tr:tree component, I want to use selection for
navigating in a separated panel.
If I place a commandLink within the nodeStamp, then I can manage events
and actions, however I don't know how to get the selected node identity.
Then I tried to use the selectionListener attribute like the following:

        <tr:tree value="#{dbTreeTrBean.treeData}" var="node"
            <f:facet name="nodeStamp">
                <tr:panelGroupLayout layout="horizontal">
                      <tr:image source="#{node.image}"/>
                      <tr:outputText value="#{node.description}"/>

but the pointed method "selection" is *never* called. The basic idea was
to force a submit on click and to manage the selection event to navigate.
Adding the onclick introduced a full can of exceptions while
expanding/restricting branches, such as "Cannot exit the root container",
"row is unavailable", or just silent expansion misbehavior. Actually I'm
using a straight ChildPropertyTreeModel as treeData.
Without onclick expansion runs fine, but then I miss the timely selection.
While I will investigate further about the wrong expansion, I still wonder
if anybody succeeded in getting those events. Demos do not use them at all.
-- Renzo