incubator-adffaces-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Renzo Tomaselli <renzo.tomase...@tecnotp.it>
Subject Re: [Trinidad] managing selection in tr:tree
Date Tue, 09 Jan 2007 15:05:34 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Renzo Tomaselli wrote:
<blockquote cite="mid45A358BA.5040401@tecnotp.it" type="cite">
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
  <font size="+1">And even worse, I wonder about those many model
errors after committing
onclick (I'm going to inspect them though).<br>
  </font></blockquote>
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).<br>
Thus I decided for the commandLink solution, which seems running fine.<br>
-- Renzo<font size="+1"><br>
</font>
<blockquote cite="mid45A358BA.5040401@tecnotp.it" type="cite">Simon
Lessard wrote:
  <blockquote
 cite="mid254acf980701081918s2f17efdfu17f15e4807c1d173@mail.gmail.com"
 type="cite">Hello Renzo, <br>
    <br>
Did you try to use Trinidad's setActionListener? I did not try with
tree but <br>
I was able to handle most selection with it before. You can try
something <br>
like: <br>
    <br>
&lt;tr:tree value="#{myTreeBean.model}" var="node"&gt; <br>
&nbsp;&lt;f:facet name="nodeStamp"&gt; <br>
&nbsp;&nbsp; &lt;tr:commandLink action="something"&gt; <br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;tr:image source="#{node.image}"/&gt;
<br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;tr:outputText value="#{node.description}"/&gt;
<br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;tr:setActionListener from="#{node}"
to=#{myTreeBean.selectedNode} /&gt; <br>
&nbsp;&nbsp; &lt;/tr:commandLink&gt; <br>
&nbsp;&lt;/f:facet&gt; <br>
&lt;/tr:tree&gt; <br>
    <br>
    <br>
Again, I did not try it with tr:tree though so it might not work, but I
    <br>
think it worth a try. <br>
    <br>
    <br>
Regards, <br>
    <br>
~ Simon <br>
    <br>
On 1/8/07, Renzo Tomaselli <a class="moz-txt-link-rfc2396E"
 href="mailto:renzo.tomaselli@tecnotp.it">&lt;renzo.tomaselli@tecnotp.it&gt;</a>
wrote: <br>
    <blockquote type="cite"><br>
&nbsp;Hi, while using a tr:tree component, I want to use selection for <br>
navigating in a separated panel. <br>
If I place a commandLink within the nodeStamp, then I can manage events
      <br>
and actions, however I don't know how to get the selected node
identity. <br>
Then I tried to use the selectionListener attribute like the following:
      <br>
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;tr:tree value="#{dbTreeTrBean.treeData}"
var="node" <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
selectionListener="#{dbTreeTrBean.selection}" <br>
onclick="submit()"&gt; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;f:facet name="nodeStamp"&gt; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;tr:panelGroupLayout layout="horizontal"&gt; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;tr:image source="#{node.image}"/&gt; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;tr:outputText
value="#{node.description}"/&gt; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/tr:panelGroupLayout&gt; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/f:facet&gt; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/tr:tree&gt;
<br>
      <br>
but the pointed method "selection" is *never* called. The basic idea
was <br>
to force a submit on click and to manage the selection event to
navigate. <br>
Adding the onclick introduced a full can of exceptions while <br>
expanding/restricting branches, such as "Cannot exit the root
container", <br>
"row is unavailable", or just silent expansion misbehavior. Actually
I'm <br>
using a straight ChildPropertyTreeModel as treeData. <br>
Without onclick expansion runs fine, but then I miss the timely
selection. <br>
While I will investigate further about the wrong expansion, I still
wonder <br>
if anybody succeeded in getting those events. Demos do not use them at
all. <br>
-- Renzo <br>
      <br>
      <br>
    </blockquote>
    <br>
  </blockquote>
</blockquote>
</body>
</html>

Mime
View raw message