假设我有这个:
<p:column headerText="R"
style=" text-align: center;"
width="10"
rendered="true">
<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>
</p:column>
现在我怎样才能使用<p:columns>
<p:columns value="#{tableBean.columns}" var="column" columnIndexVar="colIndex"
sortBy="#{column.property}" filterBy="#{column.property}">
<f:facet name="header">
#{column.header}
</f:facet>
#{car[column.property]}
</p:columns>
关于该主题的所有示例和教程仅涵盖简单的内容<h:outptText>
嵌套在列中的组件(p:graphicImage,p:commandLink等)怎么样,如上面的代码。
你是如何做到这一点的?
您可以渲染 元素内的任何元素。
您想要做的可能是根据列以不同的方式呈现单元格内容。你可以尝试这样的事情:
//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>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)