Yuan,
These features will *definitely* be in the new tree. See example JSF below:
<x:tree value="#{treeData}" var="node">
<f:facet name="branch-open">
<h:graphicImage value="/images/open-folder.gif"/>
<h:outputText value="#{node.description}"/>
</f:facet>
<f:facet name="branch-closed">
<h:graphicImage value="/images/closed-folder.gif"/>
<h:outputText value="#{node.description}"/>
</f:facet>
<f:facet name="leaf">
<h:graphicImage value="/images/document.gif"/>
<h:commandLink immediate="true" value="#{node.description}"/>
</f:facet>
</x:tree>
You will be able to configure the graphics and contents of the node
based on the node type. The example above would be for a very simple
case with no links and only two types of nodes: branch and leaf.
When constructing your tree data you have to create a series of nodes
(Composite Pattern) and specify the type of node you're creating.
Then the faces component will check the appropriate facet for each
node and render accordingly. You will be able to put whatver you want
inside the facet (commandLink, etc.) basically it will work similar to
dataTable now.
One big improvement will be the fine-grain control over the appearance
and behavior of the nodes. You are not limited to defining a single
behavior for all branches and one for all leaves. More importantly,
there will be full client-side javascript support.
Stay tuned for more details ...
sean
On Tue, 1 Feb 2005 15:08:45 -0500, Yuan Song <[EMAIL PROTECTED]> wrote:
> Sean,
> I found a solution to my problem, by adding 'action' and 'target' tags
> in x:tree. Both are applied to the node label's component (which is
> HtmlCommandLink). This way, the actions on the nodes can be controlled
> via the navigation rules.
>
> It would be great such/similar features can be incorporated in the tree
> enhancement you are planning.
>
> Thanks,
> -Yuan
>
> -----Original Message-----
> From: Sean Schofield [mailto:[EMAIL PROTECTED]
> Sent: Monday, January 31, 2005 5:17 PM
> To: Yuan Song
> Subject: Re: Fire an action on server side
>
> > In B's listener, calling:
> >
> > componentA.queueEvent(new ActionEvent(componentA));
> >
> > doesn't invoke the action itself. It only invokes A's action listener.
>
> What do you mean by "invoking the action itself"? There really isn't
> any such thing as invoking an action. ActionEvents involve two steps.
> First queue the event. Second, (at the appropriate time) notify
> listeners.
>
> Can you explain to us why you are trying to do this? Perhaps there is
> an easier way to accomplish what you are looking for ...
>
> > yuan
>
> sean
>