抱歉我的英文。我有TireDTO
课程:
public class TireDTO {
public int fromPrice;
public int toPrice;
//get and set
}
表格:
<h:inputText id="fromPrice" value="#{tireMB.tireDTO.fromPrice}"/>
<h:inputText id="toPrice" value="#{tireMB.tireDTO.toPrice}"/>
我想使用带有primefaces dataTable和LazyDataModel
的表单进行分页。
我可以发送TireDTO
代替Map<String, Object> filters
吗?
我试过TireMB
:
@PostConstruct
public void init(){
// +getter , setter
lazyModel = new LazyDataModel<Site>(){
private static final long serialVersionUID = 1L;
@Override
public List<Site> load(int first, int pageSize, String sortField,
SortOrder sortOrder, Map<String, Object> filters) {
return getDao().getResultList(getTireDTO(), first, pageSize);
}
};
lazyModel.setRowCount(20);
}
也许有更好的解决方案。