1

是否可以使用列标题创建 ap:orderlist?我试图将它编码为带有 columnGroups、rows、columns 的 dataTable ,但这没有呈现。

在我的 orderList 中,我想显示 6 列数据并希望用户看到每一列的一个标题?

4

1 回答 1

4

This might not be perfect, but it's how I managed to display some headers for an orderList. You just need to adjust the css rules, to have the header for example aligned left and whatever you want.

<p:orderList styleClass="your-orderlist" value="#{controller.fields}" var="field"
iconOnly="true" effect="clip" itemValue="#{field}" converter="#{fieldConverter}">
    <f:facet name="caption">
        <div class="your-orderlist-header" style="width: 33%;">Field Name</div>
        <div class="your-orderlist-header" style="width: 33%;">Value</div>
        <div class="your-orderlist-header" style="width: 33%;">Type</div>
    <div style="clear: both;" />
    </f:facet>

   <p:column styleClass="your-orderlist-row" style="width:33%;">
       <h:outputText value="#{field.fieldName}" />
   </p:column>
   <p:column styleClass="your-orderlist-row" style="width:33%;">
       <h:outputText value="#{field.value}" />
   </p:column>
   <p:column styleClass="your-orderlist-row" style="width:33%;">
       <h:outputText value="#{field.type}" />
   </p:column>
</p:orderList>
于 2012-11-23T10:08:15.883 回答