0 Replies Latest reply on Sep 10, 2007 1:03 PM by Richard Teviotdale

    facelet template menu conversation propagation

    Richard Teviotdale Newbie

      If you are using a facelets template which displays common menu links on every page you may require a different conversation propagation attribute value within the links depending on the view.

      In your view page when you want to change the default propagation of the menu items set the propagation type in a ui:param tag:

      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       template="layout/template.xhtml"
      >
      
       <ui:param name="menuPropagation" value="end"/>
       <ui:define name="body">
       <h1>Some View</h1>
       </ui:define>
      </ui:composition>


      In the menu template create two links for each item one for when the propagation is not set and the other for when it is:
      <div
       xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       id="menu"
      >
       <s:link
       rendered="#{menuPropagation == null}"
       view="/home.xhtml"
       value="Home"
       />
       <s:link
       rendered="#{menuPropagation != null}"
       view="/home.xhtml"
       value="Home"
       propagation="#{menuPropagation}"
       />
      
       <s:link
       rendered="#{menuPropagation == null}"
       view="/nextMenuItem.xhtml"
       value="nextMenuItem"
       />
       <s:link
       rendered="#{menuPropagation != null}"
       view="/nextMenuItem.xhtml"
       value="NextMenuItem"
       propagation="#{menuPropagation}"
       />
      
       <!-- etc ... -->
      </div>