使用带有多个排序的LazyDataModel我得到NullPointerException。当我使用sortMode =“multiple”时,load方法在属性处取空值 列出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">
在我正在调用的bean中
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();
答案 0 :(得分:1)
Multisort正在使用sortMeta对象