2 Replies Latest reply: Mar 10, 2013 6:52 AM by 995878 RSS

    Best way to reuse a layout with different values?

    995878
      I want to reuse the code of the <div id="placeInfo"> on the next page (place.xhtml). I simplified it's code for this question.
      Of course I can use <ui:include> for <div id="placeInfo"> but on the next page I would need e.g. #{myBean.selectedPlace.name} instead of #{place.name}.
      Any smart idea how to do this efficiently?
      <ui:repeat value="#{myBean.places}" var="place">
          <p:commandLink action="place?faces-redirect=true" ajax="false">
              <f:setPropertyActionListener value="#{place}" target="#{myBean.selectedPlace}" />
              <div id="placeInfo">
                  #{place.name}
                  #{place.openHours}
              </div>
          </p:commandLink>
      </ui:repeat>