Wrong values in <p:rowExpansion> and empty values in <p:cellEditor> on scrolled page when using <p:dataTable lazy=“true” liveScroll=“true”>

不想你离开。 提交于 2019-12-18 08:47:08

问题


I am using JSF 2.2 with PrimeFaces 4.0. I have a <p:dataTable> with live scrolling, lazy loading, row-expansion and cell-editing, etc.

<p:dataTable
    id="dtaTable"
    selection="#{cont.selectedArray}"
    resizableColumns="true"
    draggableColumns="true"
    var="dataModel"
    value="#{cont.yieldBondsModel}"
    editable="true"
    editMode="cell"
    selectionMode="multiple"
    rowSelectMode="add"
    scrollable="true"
    scrollHeight="650"
    rowKey="#{modeld.id}+#{model.name}"
    rowIndexVar="rowIndex"
    filterEvent="enter"
    styleClass="screenScrollStyle"
    scrollRows="25"
    liveScroll="true"
    lazy="true"
    rows="50"
    filteredValue="#{cont.filteredModel}"
    widgetVar="dt4"
>
    <p:rowExpansion>
        <h:panelGrid id="display" columns="2" cellpadding="4" style="width:300px;" styleClass="ui-widget-content grid">
            <f:facet name="header" styleClass="dataTableHeader">Other Data</f:facet>
            <h:outputText value="id " />
            <h:outputText value="#{dataModel.id}"/>
            <h:outputText value="Name" />
            <h:outputText  value="#{dataModel.name}" />
        </h:panelGrid>
    </p:rowExpansion>

    <p:column width="15">
        <p:rowToggler />
    </p:column>

    ...
</p:dataTable>

On the first page everything works like a charm. Once I scroll it down, data is getting lazy-loaded perfectly fine, but it has some problems during row-expansion and cell-editing:

  1. In row-expansion, I am getting wrong values. Maybe overlapped values from other row.

  2. Cell-editing is also not working. Once I edit any cell, values are not getting displayed in cell-editor. I have checked in Firebug, there is no value in <h:outputText> as confirmed by the generated HTML <div class="ui-cell-editor-output" style="display: none;"></div>. As you can see, there is no value inside the div.

The backing bean is @SessionScoped.

How is this caused and how can I solve it?


回答1:


This is a known issue on PrimeFaces, and already reported and fixed in Elite version (4.0.7 if I remember well). However community release does not contain this fix yet. There is an RC for PrimeFaces 5.0 which contains this fix. You can download it and test if it's suits for you needs, but be aware that this is only a release candidate, not a final release. AFAIK the ETA for the 5.0 final is the first half of May.



来源:https://stackoverflow.com/questions/23195131/wrong-values-in-prowexpansion-and-empty-values-in-pcelleditor-on-scrolled

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!