myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthias Wessendorf" <mat...@apache.org>
Subject Re: doubts about tree control
Date Mon, 05 Jun 2006 15:10:40 GMT
use action for navigation and wrap commandLink with a h:form


-Matthias

On 6/5/06, andreas.mitter@magnasteyr.com <andreas.mitter@magnasteyr.com> wrote:
> I not sure if it works(because I have never used tree2), but I would try the following:
>
> In the h:commandLink take the action parameter instead of the actionListener..
>
> This action parameter points to the method selectNode withs returns a String...
>
> public String selectNode(){
>
> ...
> return navigationstring;
> }
>
> In your faces-config.xml you do your navigation like the following:
>
>   <navigation-case>
>    <from-outcome>navigationString</from-outcome>
>    <to-view-id>/a.jsp</to-view-id>
>   </navigation-case>
>   <navigation-case>
>    <from-outcome>navigationString2</from-outcome>
>    <to-view-id>/b.jsp</to-view-id>
>   </navigation-case>
> and so on...
>
>
> Regards,
> Andy
>
> -----Urspr√ľngliche Nachricht-----
> Von: sarma [mailto:ssarma@mahindrabt.com]
> Gesendet: Montag, 5. Juni 2006 06:32
> An: users@myfaces.apache.org
> Betreff: doubts about tree control
>
>
>
> Hi there,
>
> I am using myfaces tree2 and want to be able to select a node that is
> clicked from a tree and then forward to another JSP page that will have
> details of the node on it. I have finally managed to work out how to select
> the node, but am now wondering how I can navigate to the next page.
>
> node
>  a
>  b
>  c
>
> if i clicked on a i have to  a.jsp
> if i clicked on b i hava e to b.jsp
> if i clicked on c i havae to in c.jsp
>
> <f:view>
>     <t:tree2 value="#{siteBean.treeData}" id="tree" var="node"
> varNodeToggler="t" clientSideToggle="false" preserveToggle="false">
>         <f:facet name="node">
>             <h:panelGroup>
>                 <h:commandLink styleClass="document"
> actionListener="#{siteBean.selectNode}">
>                     <h:outputText value="#{node.description}" />
>                     <f:param name="docNum" value="#{node.identifier}" />
>                 </h:commandLink>
>             </h:panelGroup>
>         </f:facet>
>     </t:tree2>
> </f:view>
>
>
> Snippet from backing bean
>
> public void selectNode(ActionEvent event)
> {
>     log.debug("ActionEvent: " + event);
>
>     UIComponent component = (UIComponent) event.getSource();
>     while (!(component != null && component instanceof HtmlTree))
>     {
>         component = component.getParent();
>     }
>     if (component != null)
>     {
>         HtmlTree tree = (HtmlTree) component;
>         TreeNodeBase node = (TreeNodeBase) tree.getNode();
>         tree.setNodeSelected(event);
>
>         // how do I now forward to another JSP?
>        if(a selected)
>         a.jsp
>        if(b selected)
>        b.jsp
>       if(c selected)
>       c.jsp
>     }
> }
>
> please give the solution .  mail me to ssarma@mahindrabt.com
>
> with regards
> shannu sarma
> --
> View this message in context: http://www.nabble.com/doubts-about-tree-control-t1733336.html#a4709850
> Sent from the MyFaces - Users forum at Nabble.com.
>
>
>
>
> This message is not legally binding upon our company!
> This communication is confidential and is intended solely for the addressee(s). If you
are not the intended recipient(s), his/her assistant, or authorized recipient, any form of
disclosure, reproduction, distribution or any use of this communication or the information
in it, is strictly prohibited and may be unlawful. In this case, please notify the sender
immediately and destroy the e-mail. Electronic communication via the Internet by e-mail may
be manipulated and/or read by third parties, thus we exclude any liability whatsoever for
this e-mail.
>
>


-- 
Matthias Wessendorf
Aechterhoek 18
48282 Emsdetten
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com

Mime
View raw message