手风琴中的dataTable在客户端过滤后不会更新

时间:2017-06-21 21:58:16

标签: primefaces accordion jsf-2.2

我在项目中使用了primefaces,而我正面临着一些问题。 我在手风琴里面有一个dataTabe,它们都在我的托管bean中填充了一个列表。问题是,在我把这个dataTable放入手风琴之前,过滤器用来工作得很好。当它进入手风琴时,实际上结果对应于过滤器,但是如果我在任何行中单击comandButton,我从“f:setPropertyActionListener”获得的对象与过滤器之后的列表不对应。

编辑:
-Pmemefaces 6.0
- 动态Web模块3.0
-Java 1.7
-Mojarra JSF实施2.2.3

.xhtml:

<h:form id="frmPrincipal" enctype="multipart/form-data">
    <p:toolbar style="background : none; border:0px">
        <f:facet name="left">
            <p:commandButton value="Novo Documento" oncomplete="PF('dlgIncluirDocumento').show();"
                actionListener="#{MyBean.prepararInclusao()}" update=":frmIncDocVal:pngIncDoc
                :frmIncDocVal:pnlTblEmail :frmIncDocVal:pnlEmailNvDoc" />
        </f:facet>
    </p:toolbar>
    <p:accordionPanel dynamic="true" value="#{MyBean.grupos}" var="grupo">
        <p:tab  title="#{grupo.nome}">
            <p:dataTable id="tbValidadeDocFiltrado" widgetVar="#{grupo.idComponente}"
                emptyMessage="Nenhum registro enccontrado" lazy="false"
                value="#{grupo.documentos}" var="item" filteredValue="#{grupo.documentosFiltrados}"
                paginator="true" rows="30" paginatorPosition="bottom" rowsPerPageTemplate="15,30,45">

                <f:facet name="header"><p:outputLabel value="Validade Documento" /></f:facet>

                <p:column headerText="Empresa" sortBy="#{item.tipoDocumento.empresa.nome}" filterBy="#{item.tipoDocumento.empresa.nome}">
                    <f:facet name="filter">
                        <p:selectOneMenu onchange="PF('#{grupo.idComponente}').filter()" >
                            <f:selectItem itemLabel="Selecione" itemValue="#{null}"
                                noSelectionOption="true" />
                            <f:selectItems value="#{MyBean.itensEmpresa}"
                                var="empresa" itemValue="#{empresa.nome}"
                                itemLabel="#{empresa.nome}" />
                        </p:selectOneMenu>
                    </f:facet>
                    <p:outputLabel value="#{item.tipoDocumento.empresa.nome}" />
                </p:column>
                <p:column headerText="Departamento"
                    sortBy="#{item.tipoDocumento.departamento.nome}"
                    filterBy="#{item.tipoDocumento.departamento.nome}">
                    <f:facet name="filter">
                        <p:selectOneMenu onchange="PF('#{grupo.idComponente}').filter()">
                            <f:selectItem itemLabel="Selecione" itemValue="#{null}"
                                noSelectionOption="true" />
                            <f:selectItems value="#{MyBean.itensDepartamento}"
                                var="departamento" itemValue="#{departamento.nome}"
                                itemLabel="#{departamento.nome}" />
                        </p:selectOneMenu>
                    </f:facet>
                    <p:outputLabel value="#{item.tipoDocumento.departamento.nome}" />
                </p:column>
                <p:column headerText="Documento" sortBy="#{item.tipoDocumento.nome}"
                    filterBy="#{item.tipoDocumento.nome}">
                    <p:outputLabel value="#{item.tipoDocumento.nome}" />
                </p:column>
                <p:column headerText="Arquivo">
                    <p:commandLink title="Download" value="#{item.arquivo.nome}" ajax="false" onclick="PrimeFaces.monitorDownload(start, stop);" rendered="#{item.cadastroDocumentoDownload}" disabled="#{ ! item.icArquivo}">
                        <f:setPropertyActionListener value="#{item}" target="#{MyBean.validadeDocumento}" />
                        <p:fileDownload value="#{MyBean.fileDown}" />
                    </p:commandLink>
                </p:column>
                <p:column headerText="Opções" exportable="false" width="160">
                    <p:commandButton icon="ui-icon-pencil" title="Alterar"
                        oncomplete="PF('dialog1').show();"
                        disabled="false" rendered="#{item.cadastroDocumentoEditar}"
                        action="#{MyBean.prepararAlterarTipoDocumento()}"
                        update=":idTituloTpDocTituloTelaDlgAlt :frmAltTpDoc:pngAltDoc">
                        <f:setPropertyActionListener  value="#{item}" target="#{MyBean.validadeDocumento}" />
                    </p:commandButton>
                </p:column>
            </p:dataTable>
        </p:tab>
    </p:accordionPanel>
</h:form>

使用命令按钮打印:

Print with the command button working

过滤后使用命令按钮打印不起作用:

Print with the command button not working after filter

0 个答案:

没有答案