Renzo Tomaselli wrote:
And even worse, I wonder about those many model errors after committing onclick (I'm going to inspect them though).
Well - in case anybody is interested - it seems that onclick from a tree plays some dirty game, like submitting twice, since my bean constructor is called twice after any expand-icon click. Then a wide range of errors. Refreshing appears ok, though (constructor called once).
Thus I decided for the commandLink solution, which seems running fine.
-- Renzo
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
like:

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


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


Regards,

~ Simon

On 1/8/07, Renzo Tomaselli <[EMAIL PROTECTED]> 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"
                selectionListener="#{dbTreeTrBean.selection}"
>
            <f:facet name="nodeStamp">
                <tr:panelGroupLayout layout="horizontal">
                      <tr:image source="#{node.image}"/>
                      <tr:outputText value="#{node.description}"/>
                </tr:panelGroupLayout>
            </f:facet>
        </tr:tree>

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



Reply via email to