dev@jsftemplating.java.net

how to use childCommand with dynamic tree node ?

From: Anissa Lam <Anissa.Lam_at_Sun.COM>
Date: Wed, 23 Aug 2006 18:13:05 -0700

My goal is that when a user clicks on a dynamic tree node, it will
navigate to a page depending on the display name of this dynamic node.
eg. If the web application node has a display name being 'hello', i
would like to navigate to a page "applications/webAppEdit.jsf?webapp=hello"
I was thinking to write a handler that will go through the UI components
and get the name of this dynamic tree node, ie, 'hello'. The handler
will then output the url of the page to navigate to.

Is this a right approach to do the task ?

My problem is that the handler was never called, am i using the
correct syntax ? I thought the <!childCommand> shouldn't be inside an
<event> tag.

Also, if you can show me the code segment to get the display name of the
selected dynamic tree code, that will help a lot.

Here is how my .jsf file looks like:

<dynamicTreeNode id="webApplications"
            
treeAdaptorClass="com.sun.enterprise.tools.admingui.tree.MBeanTreeAdaptor"
            objectName="com.sun.appserv:type=applications,category=config"
            methodName="getAllDeployedWebModules"
            text="$resource{i18n.tree.WebApps}"
            url="../admingui/webApplications"
            imageURL="images/folder.gif"
            target="main"
            expanded="$boolean{false}"
            attributeName="name"
            childImageURL="images/webModule.gif"
            childTarget="main"
            childExpanded="$boolean{false}"
>
           *<!childCommand
                println(value="!!! childCommand !!!");
                getNavigateURL(editPage="applications/webAppEdit",
url=>$attribute(url));
                navigate(page=$attribute(url));
            />*
            <!filterTree filterSystemApps() />
</dynamicTreeNode>


Thanks
Anissa.