How can I get the nested components of a <p:column> in a facelet using EL

我与影子孤独终老i 提交于 2019-12-02 08:26:05

You can render any element inside the <p:columns> element.

What you want to do is probably render the cell contents differently, depending on the column. You can try something like this :

  //classic rendering (for all cells)
  <h:outputText value="#{car[column.property]}"/>

  //conditional rendering (for 'report' cells only)
  <h:panelGroup rendered="#{column.property == 'report'}">
    <p:commandLink id="MRepShowButton" update=":form1:display" onclick="EditorDialog.show();"  title="Editer le compte rendu">
      <f:setPropertyActionListener value="#{exam}" target="#{dyna.selectedExamen}" />  
      <p:graphicImage id="img1" value="/images/study_Report_icons/Text/0.png" rendered="#{exam.examen.rapport.rapportWrittenState == null}"/>
      <p:graphicImage id="img2" value="/images/study_Report_icons/Text/#{exam.examen.rapport.rapportWrittenState}.png" rendered="#{exam.examen.rapport.rapportWrittenState != null}"/>
    </p:commandLink>
  </h:panelGroup>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!