3

使用具有多重排序的 LazyDataModel 我得到 NullPointerException。当我使用 sortMode="multiple" 时,加载方法在属性 List multiSortMeta 处采用空值

我的 xhtml

<h:panelGroup id="processPanel">
            <p:dataTable id="processTable" value="#{hubProcessBean.processModel}"
                var="process" paginator="true" paginatorAlwaysVisible="false"
                 rows="5" lazy="true" sortBy="#{process.transactionId}" sortOrder="ascending" rows="5" lazy="true" sortMode="multiple" resizableColumns="true">

在我打电话的豆子里

processModel_ = new TransactionLazyDataModel(criteria);

我的 LazyDataModel 是

@Override
    public List<Transaction> load(int first, int pageSize, List<SortMeta> multiSortMeta, Map<String,String> filters) {
        try {
            HibernateUtil.beginTransaction();
            transactionList = transactionHome.loadByCriterion(criterias_,first, pageSize, multiSortMeta);
            for (Transaction tr : transactionList) {
                Hibernate.initialize(tr.getAgency());
                Hibernate.initialize(tr.getClient().getId().getClientName());
                Hibernate.initialize(tr.getDecisionrule().getId());
                //Hibernate.initialize(tr.getEscalationhistory().getEscalationtype().getEscalationTypeId());
                Hibernate.initialize(tr.getUserByBuyer());
                //Hibernate.initialize(tr.getDecisionrule().getId());
            }
            HibernateUtil.commitTransaction();
4

1 回答 1

1

Multisort 正在使用 sortMeta 对象

于 2013-03-16T17:55:13.540 回答