Jsf 2 jsf h:dataTable在4列上
我有以下简单的代码: 它打印出一些标签,但它显示 只有两列 但在panelGrid中,我已经指定了Jsf 2 jsf h:dataTable在4列上,jsf-2,Jsf 2,我有以下简单的代码: 它打印出一些标签,但它显示 只有两列 但在panelGrid中,我已经指定了 columns=4 我想要4列而不是2列 守则: <p:tab title="Details Udfs" rendered="#{errorContractBean.flagMoneyD}"> <h:panelGrid id="detailsudfM" columns="4" cellpadding="5" sty
columns=4
我想要4列而不是2列
守则:
<p:tab title="Details Udfs" rendered="#{errorContractBean.flagMoneyD}">
<h:panelGrid id="detailsudfM" columns="4" cellpadding="5" style="margin-bottom:5px" styleClass="grid">
<h:dataTable var="o" value="#{errorContractBean.liM}">
<h:column>
<h:outputText value= "#{o.udf}"/>
</h:column>
<h:column>
<h:outputText value= "#{o.value}" style="font-weight:bold;"/>
</h:column>
</h:dataTable>
</h:panelGrid>
</p:tab>
电流输出:
期望输出:
面板网格实际上有4列,但在第一行和第一列中有datatable,datatable只有2列。我认为你不应该在这里使用数据表。改用facelets
c:forEach
-标记。请尝试以下操作:
<h:panelGrid columns="4">
<c:forEach var="o" items="#{errorContractBean.liM}">
<h:outputText value= "#{o.udf}"/>
<h:outputText value= "#{o.value}" style="font-weight:bold;"/>
</c:forEach>
</h:panelGrid>
名称空间c来自哪里?我没有它这是JSTL核心标记的名称空间。使用xmlns:c=”http://java.sun.com/jsp/jstl/core“