ui:在ui内部或内部重复:重复不起作用

时间:2017-09-28 17:17:09

标签: jsf primefaces xhtml uirepeat

我在另一个<ui: repeat>内使用<ui: repeat>时遇到问题。让我们看看代码来更好地解释它:

<h:form>
  <ui:repeat  value="#{myManagedBean.listDocsFather}" var="dad">
    <p:commandLink update="myPanel" process="@this" >
      <f:setPropertyActionListener target="#{myManagedBean.doc}" value="#{dad.docId}" />
        <div>
          <h:outputLabel value="Document #{dad.docId.name} " />
        </div>
     </p:commandLink>

     <!--here I execute a method to find the father's children's documents-->
     <ui:repeat  value="#{myManagedBean.listDocsSons(dad.id)}" var="child"> 
       <p:commandLink update="myPanel" process="@this" >
         <f:setPropertyActionListener target="#{myManagedBean.doc}" value="#{child.docId}" />
         <div>
             <h:outputLabel value="Document child #{childs.docId.name} " />
          </div>
       </p:commandLink>
     </ui:repeat> 

   </ui:repeat>     

   <h:panelGroup id="myPanel" >
     <!--if docId not null see my document-->     
   </h:panelGroup>
</h:form>

我的问题是很多次我的listDocsSons方法被执行,即使父母只有一个记录,我做错了或者如何找到子文档,重要的是澄清这段代码仍然存在性能问题当为父母运行这么多次相同的方法时。请帮帮我 !!我是JSF的新手。

0 个答案:

没有答案
相关问题