Reusing the same page multiple times

巧了我就是萌 提交于 2019-12-05 10:38:04

You can use <ui:param> to pass parameters to <ui:include>:

<rich:tabPanel id="creditScoreTab" switchType="client" >
  <rich:tab id="mainContractor" >
    <f:subview id="mainContractorView">
      <ui:include src="includes/prospect.xhtml">
        <ui:param name="person" value="#{bean.person1}" />
      </ui:include>
    </f:subview>
  </rich:tab>
  <rich:tab id="guarantor">
    <f:subview id="guarantorView">
      <ui:include src="includes/prospect.xhtml">
        <ui:param name="person" value="#{bean.person2}" />
      </ui:include>
    </f:subview>
  </rich:tab>
</rich:tabPanel>

With the above example, in each include the desired person will be available as #{person}. Those <f:subview> tags are to prevent duplicate component ID errors because they end up within the same UINamingContainer parent.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!