保存过滤器和排序顺序值

时间:2012-09-24 12:02:39

标签: user-interface jsf-2 primefaces

我的全局过滤器通过更新表来保存所选值。表格通过bevor更新等文本进行过滤。在列中,sortBy或filterBy在更新/刷新dataTable后清理并清空...如何在列中保存filterBy和sortBy的类型值? 以下是一些代码段:

  <h:form id="showEmployees">
        <p:dataTable id="liste" value="#{employeeView.allEmployeeList}"
            filteredValue="#{employeeView.filteredEmployees}" var="employee"
            widgetVar="employeeTable" resizableColumns="true"
            emptyMessage="#{msg.noData}" rowKey="#{employee}"
            selection="#{employeeView.selected}" selectionMode="single"
            tableStyle="width:auto">

            <p:ajax event="rowDblselect" listener="#{employeeView.onRowSelect}"
                update=":employeeEditDialog" oncomplete="dlgEmployeeEdit.show()" />

            <f:facet name="header">
                <p:commandButton value="#{msg.employeeAdd}" id="addButton"
                    update=":employeeEditDialog" oncomplete="dlgEmployeeEdit.show()">
                </p:commandButton>
                <p:outputPanel>
                    <h:outputText value="#{msg.searchField}" />
                    <p:inputText id="globalFilter" onkeyup="employeeTable.filter()"
                        style="width:150px" />
                    <p:commandButton value="#{msg.export}" ajax="false"
                        action="#{employeeView.exportExcel()}" />
                </p:outputPanel>
            </f:facet>

            <p:column filterBy="#{employee.active}" headerText="#{msg.active}"
                filterOptions="#{employeeView.activeOptions}"
                filterMatchMode="exact" sortBy="#{employee.active}">
                <h:outputText value="#{(employee.active) ? 'X' : ''}" />
            </p:column>

            <p:column filterBy="#{employee.salutation.description}"
                filterMatchMode="contains"
                sortBy="#{employee.salutation.description}"
                headerText="#{msg.salutation}">
                <h:outputText value="#{employee.salutation.description}" />
            </p:column>

如何存储实际过滤器和排序值?

0 个答案:

没有答案