我有一个数据表:
<p:dataTable id="pDataTableListaRegistros"
var="registro"
value="#{arquivoBean.listaRegistros}"
paginator="true"
rows="20"
filteredValue="#{arquivoBean.filteredListaRegistros}"
styleClass="tabelaCentralizada">
我想获取在过滤器字段“代码”,“数据执行注册数据”和“Usuário”中输入的值,以便在备用Bean中进行操作。
最佳答案
您可以通过以下方式从数据表中获取过滤器值:
<p:dataTable binding="#{arquivoBean.theDataTable}" id="pDataTableListaRegistros" var="registro" value="#{arquivoBean.listaRegistros}" paginator="true" rows="20" filteredValue="#{arquivoBean.filteredListaRegistros}" styleClass="tabelaCentralizada"/>
在您的后备 bean 中:
DataTable theDataTable = new DataTable();
//getter and setter
Map<String, String> theFilterValues = theDataTable.getFilters(); //This returns a map of column-filterText mapping.