incubator-adffaces-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Lessard" <simon.lessar...@gmail.com>
Subject Re: [Trinidad] managing selection in tr:tree
Date Tue, 09 Jan 2007 03:18:58 GMT
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="something">
      <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 <renzo.tomaselli@tecnotp.it> 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}"
> onclick="submit()">
>             <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
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message