Bru*_*mps 1 java datatable primefaces
我正在使用 primefaces Datatable 来显示大约 1000 行(和 7 列)。它运行速度很快,但是当我过滤列并尝试按不同列对数据集进行排序时,我会出现奇怪的行为。\n这是一个示例:在第一张图片中,加载时有数据表,看起来很棒。它受到严格审查,因为我正在处理敏感数据。在第二张图片中,我过滤了 2 列,数据表在此之前工作正常,但如果我在此之后对第三列进行排序,我将停止工作,不会显示正确的行。我的数据中不存在其中显示的值(“n\xc3\xa3o 确定”和大量白色字段)。
\n\n\n\n这是我的代码:
\n\n<p:dataTable var="prot" value="#{myBean.listaProtocolos}" rows="15" \n sortBy="#{prot.dataEntradaArea}" sortFunction="#{myBean.sortXMLDatas}" \n sortOrder="descending" paginator="true" style="font-size: 0.9em;" \n paginatorPosition="bottom">\n <p:column filterBy="${prot.nrProtocolo}" filterMatchMode="contains" \n width="8%" style="text-align:center">\n <f:facet name="header">ID</f:facet>\n <p:commandLink action="#{myBean.verDetalhesProtocolo}">\n <h:outputText value="#{prot.nrProtocolo}" \n style="text-decoration: underline;"/>\n <f:setPropertyActionListener target="#{myBean.nrProtocolo}"\n value="#{prot.nrProtocolo}" />\n </p:commandLink>\n </p:column>\n <p:column filterBy="${prot.nrProcesso}" filterMatchMode="contains"\n width="10%">\n <f:facet name="header">N\xc3\xbamero</f:facet>\n <h:outputText value="#{prot.nrProcesso}" />\n </p:column>\n <p:column filterBy="${prot.tipoDeProtocoloDescricao}" \n filterOptions="#{myBean.filtrosTipoDeProtocoloDescricao}" \n width="10%">\n <f:facet name="header">Processo / Protocolo</f:facet>\n <h:outputText value="#{prot.tipoDeProtocoloDescricao}" />\n </p:column>\n <p:column filterBy="${prot.assunto}" sortBy="#{prot.assunto}"\n filterMatchMode="contains" width="30%">\n <f:facet name="header">Assunto</f:facet>\n <h:outputText value="#{prot.assunto}" />\n </p:column>\n <p:column filterBy="${prot.areaAtual}" sortBy="#{prot.areaAtual}"\n filterMatchMode="contains" width="15%">\n <f:facet name="header">\xc3\x81rea Atual</f:facet>\n <h:outputText value="#{prot.areaAtual}" />\n </p:column>\n <p:column filterBy="${prot.tipo}" sortBy="#{prot.tipo}"\n filterMatchMode="contains" width="17%">\n <f:facet name="header">Tipo</f:facet>\n <h:outputText value="#{prot.tipo}" />\n </p:column>\n <p:column filterBy="${prot.dataEntradaAreaFormatada}" \n sortBy="#{prot.dataEntradaArea}" sortFunction="#{myBean.sortXMLDatas}"\n filterMatchMode="contains" width="10%" style="text-align:center">\n <f:facet name="header">Data de Entrada</f:facet>\n <h:outputText value="#{prot.dataEntradaAreaFormatada}" />\n </p:column>\n</p:dataTable>\nRun Code Online (Sandbox Code Playgroud)\n\n我正在使用 primefaces v6.0。myBean 是@SessionScoped。
\n\n为什么会发生这种行为?
\n我注意到您在 p:datatable 标记中缺少一个重要值,即filteredValue =“”,它是另一个类似于value =“”的列表,其中包含过滤后的值。
filteredValue="#{myBean.filteredListaProtocolos}"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3473 次 |
| 最近记录: |