This content has been marked as final.
Show 2 replies
-
1. Re: Navigation Bug
egoosen Sep 25, 2009 9:52 AM (in response to egoosen)Created this workaround in the mean time:
<s:link action="#{categoryHome.getViewId()}" value="#{subCategory.name}"> <f:param name="categoryId" value="#{subCategory.id}"/> </s:link>
public String getViewId(){ if (getChildCategories().isEmpty()){ return "/products.xhtml"; } else { return "/category.xhtml"; } }
-
2. Re: Navigation Bug
verbalkint81 Dec 27, 2009 11:17 PM (in response to egoosen)I have this workaround for you, which avoids having another component just for redirection purposes:
<action execute="#{categoryHome.childCategories}" /> <navigation> <rule if-outcome="0"> <redirect view-id="/products.xhtml"> <param name="categoryId" value="#{categoryHome.categoryId}" /> </redirect> </rule> <!-- if-outcome is not 0 --> <rule> <!--do something else --> </rule> </navigation>
There is not much documentation on navigation in the official seam doc. It would seem like this would work but doesn't for me as well (I am using 2.1.1.GA):
<navigation evaluate="#{categoryHome.childCategories}"> <rule if-outcome="0"> <redirect view-id="/products.xhtml"> <param name="categoryId" value="#{categoryHome.categoryId}" /> </redirect> </rule> </navigation>
Let me know if you find something better!