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 [EMAIL PROTECTED]

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.

Reply via email to