Same parameters getting used irrespective of which pretty link I click

Splash Forums PrettyFaces Users Same parameters getting used irrespective of which pretty link I click

This topic contains 1 reply, has 2 voices, and was last updated by  Christian Kaltepoth 10 years, 4 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #18023


    I have this JSF page where I am displaying two sets of links (categories and dietChoices). Depending on which link the user clicks, different values/parameters are passed to the url.

    <div class=”foyo-food-filter”>

    <div class=”foyo-category-filter”>


      <ui:repeat value=”#{staticCacheManager.allCategories}” var=”category”>

    • <h:link value=”#{category.categoryName}” outcome=”pretty:findProductByCategory”>

      <f:param name=”displayType” value=”foodgroup”/>

      <f:param name=”categoryName” value=”#{cx:encodeWithDash(category.categoryName)}”/>

      <f:param name=”categoryId” value=”#{category.categoryId}”/>


    • </ui:repeat>


    <div class=”foyo-nutrient-filter”>


      <ui:repeat value=”#{staticCacheManager.dietChoices}” var=”nutrient”>

    • <h:link value=”#{nutrient.dietChoiceDescription}” outcome=”pretty:findProductByNutrient”>

      <f:param name=”displayType” value=”dietchoice”/>

      <f:param name=”dietChoice” value=”#{cx:encodeWithDash(nutrient.dietChoiceDescription)}”/>

      <f:param name=”nutrientNumber” value=”#{nutrient.nutrientNumber}”/>


    • </ui:repeat>



    In the pretty-config.xml I have two url mappings both going to the same page

    <url-mapping id=”findProduct”>

    <pattern value=”/food/” />

    <view-id value=”/food.jsf” />


    <url-mapping id=”findProductByCategory” parentId=”findProduct”>

    <pattern value=”#{displayType:foodManager.displayType}/#{categoryId:foodManager.categoryId}/#{categoryName}/” />

    <view-id value=”/food.jsf” />


    <url-mapping id=”findProductByNutrient” parentId=”findProduct”>

    <pattern value=”#{displayType:foodManager.displayType}/#{nutrientNumber:foodManager.nutrientNumber }/#{dietChoice}/”/>

    <view-id value=”/food.jsf” />


    Also in the food.jsf I have the metadata params


    <f:viewParam name=”categoryId” value=”#{foodManager.categoryId}” />

    <f:viewParam name=”nutrientNumber” value=”#{foodManager.nutrientNumber}” />


    But when I check in the managed bean behind the food.jsf

    categoryParam = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get(“categoryId”);

    nutrientNumber = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get(“nutrientNumber”);

    Even when I clicked findProductByNutrient link, the parameter nutrientNumber does not seem to get passed. For some reason the value passed for nutrientNumber gets set to categoryId. Am I doing anything wrong?


    Could you tell us which PrettyFaces version you are using? And which container and JSF implementation (and their version)?

Viewing 2 posts - 1 through 2 (of 2 total)

The forum ‘PrettyFaces Users’ is closed to new topics and replies.

Comments are closed.