I know there was some discussion on the -dev list about
tree2 selection differences between tree1.

One of the things that I'm liking about Tree1 is the
ability to easily show which nodes are selected (they
are bolded, hilighted, etc.)

Does this feature exist in tree2?  I basically need
the ability to set the selected tree nodes from the
model & have them visually cued.

-- Jon


On Mar 18, 2005, at 10:34 AM, Borja Mart�n wrote:

Yes, I could get the selected node without problem. I paste the code snippet in case it could help anyone else:
<x:tree2 id="secciones"
value="#{sections.data}"
var="section"
varNodeToggler="t">
<f:facet name="section">
<h:panelGroup>
<f:facet name="expand">
<h:graphicImage value="images/yellow-folder-open.png" rendered="#{t.nodeExpanded}" border="0"/>
</f:facet>
<f:facet name="collapse">
<h:graphicImage value="images/yellow-folder-closed.png" rendered="#{!t.nodeExpanded}" border="0"/>
</f:facet>
<h:commandLink actionListener="#{sections.select}">
<h:outputText value="#{section.description}" />
</h:commandLink>
</h:panelGroup>
</f:facet>
</x:tree2>


public void select(ActionEvent ae)
{
   UIComponent comp = ae.getComponent();
   HtmlTree tree = (HtmlTree) comp.getParent().getParent();
   TreeNodeBase node = tree.getNode();
}

bye!

Sean Schofield wrote:

x:treeselectionlistener is for tree.  Tree2 does not use that (as you
have probably figured out already.)  Tree2 can use an action listener
to indicate which node was selected (similar to what you were trying.)

Do you have it working now?  It sounded like from your last message
that you are ok with tree2 and node selection now.

sean

On Fri, 18 Mar 2005 19:13:47 +0100, Borja Mart�n <[EMAIL PROTECTED]> wrote:

sorry, but the problem was that I had some html without the f:verbatim
tags and that's why the actions weren't called


Borja Mart�n wrote:


hi,
I was trying to get the tree2 working and have found that the
TreeSelectionListener tag (x:treeselectionlistener) doesnt work, it
says the component isnt a component tree. I tried to insert an
actionListener like this #{sections.select} and created the method
public void select(ActionEvent ae){..} in the sections bean, but it
isnt called
which should be the way to get the selected node using the tree2
component?

thanks in







Reply via email to