You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Neal Katz <na...@gmail.com> on 2005/07/06 11:45:24 UTC

Tree2 Action Behavior Problem

I am having a problem using tree2 and would appreciate any help

I am using Tree2 to perform navigation thru a catalog
My tree has 2 types of leaf nodes, a "item" and a "manufacturer".
Implementation wise these are the 'type' attributes of TreeNode

The data structure is populated with 4 leaf nodes of each type.

The tree is displayed in a panel on the left side of the page.

In my JSP page I have two seperate facets for the types.
Inside the facet I have a h:commandlink which uses different actions
"gotoItem" and "gotoManufacturer"

Here is my problem, the FIRST time I use the Tree2 everything works
fine and I go to the correct page. After that if I select a node of a
different type I go to the wrong page.
(ex  I select an item node, gotoItem action is used, I'm forwarded to
the correct page. If I then click on a manufacturer page I get
forwarded to the item page incorrectly ).

This has 'something' to do with the action handling. Since as a test I
removed gotoManufacturer from faces-config and I never got an error.

Anyone got any suggestions ??? I'm using client side tree2, server
side was not working at all.

( Tomcat 5.5, using Sun JSF Implementation, Windows XP )
---- snippet ---
					<x:tree2 value="#{catalogAccessorBean.myFaceTreeData}" id="catalog"
						var="node" varNodeToggler="t" clientSideToggle="true">
						<f:facet name="item">
							<h:panelGroup>
								<h:commandLink 
								immediate="false" action="gotoItem" styleClass="document">
									<h:graphicImage value="images/document.png" />
									<h:outputText value="#{node.description}" />
									<f:param name="itemId" value="#{node.identifier}" />
									<f:param name="itemDescription" value="#{node.description}" />
								</h:commandLink>
							</h:panelGroup>
						</f:facet>
						<f:facet name="manufacturer">
							<h:panelGroup>
								<h:commandLink 
								immediate="false" action="gotoManufacturer" styleClass="document">
									<h:graphicImage value="images/document.png" />
									<h:outputText value="#{node.description}" />
									<f:param name="itemId" value="#{node.identifier}" />
									<f:param name="itemDescription" value="#{node.description}" />
								</h:commandLink>
							</h:panelGroup>
						</f:facet>

Re: Tree2 Action Behavior Problem

Posted by Sean Schofield <se...@gmail.com>.
There are a few known issues with tree2 and the RI (see recent
dicussions.)  My suggestion is to try it with MyFaces implementation
for now.  Once you get it working there switch back to RI and try to
figure out what the problem is.  If you detect a new problem (after
searching existing ones in JIRA) a new bug report would be in order
(and a bug fix even better.)

We're going to try and start testing all of the tomahawk components
against the RI soon.  We just finished a major SVN reorg so getting
the nightly builds up, etc. takes priority right now.

sean

On 7/6/05, Neal Katz <na...@gmail.com> wrote:
> I am having a problem using tree2 and would appreciate any help
> 
> I am using Tree2 to perform navigation thru a catalog
> My tree has 2 types of leaf nodes, a "item" and a "manufacturer".
> Implementation wise these are the 'type' attributes of TreeNode
> 
> The data structure is populated with 4 leaf nodes of each type.
> 
> The tree is displayed in a panel on the left side of the page.
> 
> In my JSP page I have two seperate facets for the types.
> Inside the facet I have a h:commandlink which uses different actions
> "gotoItem" and "gotoManufacturer"
> 
> Here is my problem, the FIRST time I use the Tree2 everything works
> fine and I go to the correct page. After that if I select a node of a
> different type I go to the wrong page.
> (ex  I select an item node, gotoItem action is used, I'm forwarded to
> the correct page. If I then click on a manufacturer page I get
> forwarded to the item page incorrectly ).
> 
> This has 'something' to do with the action handling. Since as a test I
> removed gotoManufacturer from faces-config and I never got an error.
> 
> Anyone got any suggestions ??? I'm using client side tree2, server
> side was not working at all.
> 
> ( Tomcat 5.5, using Sun JSF Implementation, Windows XP )
> ---- snippet ---
>                                         <x:tree2 value="#{catalogAccessorBean.myFaceTreeData}" id="catalog"
>                                                 var="node" varNodeToggler="t" clientSideToggle="true">
>                                                 <f:facet name="item">
>                                                         <h:panelGroup>
>                                                                 <h:commandLink
>                                                                 immediate="false" action="gotoItem" styleClass="document">
>                                                                         <h:graphicImage value="images/document.png" />
>                                                                         <h:outputText value="#{node.description}" />
>                                                                         <f:param name="itemId" value="#{node.identifier}" />
>                                                                         <f:param name="itemDescription" value="#{node.description}" />
>                                                                 </h:commandLink>
>                                                         </h:panelGroup>
>                                                 </f:facet>
>                                                 <f:facet name="manufacturer">
>                                                         <h:panelGroup>
>                                                                 <h:commandLink
>                                                                 immediate="false" action="gotoManufacturer" styleClass="document">
>                                                                         <h:graphicImage value="images/document.png" />
>                                                                         <h:outputText value="#{node.description}" />
>                                                                         <f:param name="itemId" value="#{node.identifier}" />
>                                                                         <f:param name="itemDescription" value="#{node.description}" />
>                                                                 </h:commandLink>
>                                                         </h:panelGroup>
>                                                 </f:facet>
>