我正在使用Primefaces 5.1与tomcat 7和SQL Server for database。我有一个存储过程来查询用户的几个属性。
我想找出
存储过程:
SELECT *
FROM table
WHERE age >=? and income >=?
支持bean
@ManagedBean(name="userBean")
@RequestScoped
public class UserBean {
private String firstName;
private int income;
private int age;
private int filter_income;
private int filter_age;
getter/setter ......
的index.xhtml
<h:form id="form">
<p:dataTable id="userTable" value="#{userDAO.data}" var="ut" >
<p:column headerText="First Name">
<h:outputText value="#{ut.firstName}" />
</p:column>
<p:column headerText="Income" style="text-align:right;" width="120"
filterBy="#{ut.income}"
filterFunction="#{dataFilter.filterByIncome}" binding="#{userBean.filter_income}" filterEvent="enter" >
<h:outputText value="#{ut.income}">
<f:convertNumber currencySymbol="$" type="currency" />
</h:outputText>
</p:column>
<p:column headerText="Age" style="text-align:right;" width="120"
filterBy="#{ut.age}"
filterFunction="#{dataFilter.filterByAge}" binding="#{userBean.filter_age}" filterEvent="enter" >
<h:outputText value="#{ut.age}" />
</p:column>
基本上,我想在存储过程中使用自己的过滤方法。通过利用primefaces数据表。