无法对rich进行排序:scrollabledatatable

时间:2017-04-18 13:46:13

标签: spring jsf richfaces

我正在尝试使用 rich:scrollableDataTable 创建一个表格。我能够在桌面上看到数据,因为我无法从浏览器中对其进行排序。我都没有收到任何错误。任何人都可以建议我,我错过了什么?我是DataTables的新手。

facelet的代码和bean代码如下:

  • JSF 1.2
  • RichFaces 3.3.GA

    <rich:scrollableDataTable  width="1000px" id="slowJobPerTable"
                           value="#{bean.model}"
                           sortOrder="#{bean.order}"
                           selection="#{bean.selection}"
                           var="jobList"                               
                           sortMode="multiple"
                           style="border:0px solid black;">
    
    <rich:column  width="130px" id="slowJobDate" style="padding:0px;">
        <f:facet name="header" class="data-table-header3" parent="slowJobDate">
            <h:outputText value="Date" style="color:black;"/>
        </f:facet>
        <h:outputText value="#{jobList.startRunDate}" style="align:center;"/>
    </rich:column>
    
    <rich:column  width="350px" style="padding:0px;" id="slowJobDesc" >
        <f:facet name="header" class="data-table-header3" parent="slowJobDesc">
            <h:outputText value="Job Description" style="align:center;color:black;" />
        </f:facet>
        <h:outputText value="#{jobList.jobDescription}"/>
    </rich:column>
    
    <rich:column width="130px" style="padding:0px;" id="slowJobType" >
        <f:facet name="header" class="data-table-header3" parent="slowJobType">
            <h:outputText  value="Job Type" style="align:center;color:black;" />
        </f:facet>
        <h:outputText value="#{jobList.jobType}"/>
    </rich:column>
    
    <rich:column styleClass="right-align" width="130px" style="padding:0px;" id="slowJobDuration" >
        <f:facet name="header" class="data-table-header3" parent="slowJobDuration">
            <h:outputText value="Duration" style="align:center;color:black;" />
        </f:facet>
        <h:outputText value="#{jobList.timeTaken}"/>
    </rich:column>
    
    <rich:column styleClass="right-align" width="130px" style="padding:0px;" id="slowJobRecords" >
        <f:facet name="header" class="data-table-header3" parent="slowJobRecords">
            <h:outputText value="Records" style="align:center;color:black;" /> 
        </f:facet>
        <h:outputText value="#{jobList.records}"/>
    </rich:column>
    
    <rich:column styleClass="right-align" width="130px" style="padding:0px;" id="slowJobRate">
        <f:facet name="header" class="data-table-header3" parent="slowJobRate">
            <h:outputText value="Rate" style="align:center;color:black;" /> 
        </f:facet>
        <h:outputText value="#{jobList.rate}"/>
    </rich:column>
    

My Bean Class如下:

@Controller("bean")
public class BatchThroughputBean implements Serializable {

private SortOrder order = new SortOrder();
private SimpleSelection selection = new SimpleSelection();

public BatchThroughputBean() {
        SortField[] fields = {
            new SortField("startRunDate", false),
            new SortField("jobDescription", false),
            new SortField("jobType", true),
            new SortField("timeTaken", false),
            new SortField("records", false),
            new SortField("rate", false)
        };
        order.setFields(fields);
    }

    public SortOrder getOrder() {
    return order;
    }

    public void setOrder(SortOrder order) {
        this.order = order;
    }

    public SimpleSelection getSelection() {
        return selection;
    }

    public void setSelection(SimpleSelection selection) {
        this.selection = selection;
    }
}

0 个答案:

没有答案