<p:rowExpansion> 中的错误值和 <p:cellEditor> 中的空值在滚动页面上使用 <p:dataTable lazy="true";liveScroll="true"> [英] Wrong values in <p:rowExpansion> and empty values in <p:cellEditor> on scrolled page when using <p:dataTable lazy="true" liveScroll="true">

查看:24
本文介绍了<p:rowExpansion> 中的错误值和 <p:cellEditor> 中的空值在滚动页面上使用 <p:dataTable lazy="true";liveScroll="true">的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 PrimeFaces 4.0 中使用 JSF 2.2.我有一个 实时滚动延迟加载, row-expansion单元格编辑等>

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. 在行扩展中,我得到了错误的值.可能与其他行的值重叠.

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

单元格编辑也不起作用.一旦我编辑了任何单元格,值就不会显示在单元格编辑器中.我已经检查了 Firebug,在 <h:outputText> 中没有值,正如生成的 HTML <div class="ui-cell-editor-output" style="显示:无;"></div>.可以看到,div里面没有值.

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.

支持 bean 是 @SessionScoped.

The backing bean is @SessionScoped.

这是怎么引起的,我该如何解决?

How is this caused and how can I solve it?

推荐答案

这是 PrimeFaces 上的一个已知问题,并且已经在 Elite 版本(如果我没记错的话,是 4.0.7)中报告和修复.然而,社区版本尚不包含此修复程序.PrimeFaces 5.0 有一个 RC,其中包含此修复程序.您可以下载并测试它是否适合您的需要,但请注意,这只是一个候选版本,而不是最终版本.AFAIK 5.0 决赛的预计到达时间是 5 月上半月.

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.

这篇关于&lt;p:rowExpansion&gt; 中的错误值和 &lt;p:cellEditor&gt; 中的空值在滚动页面上使用 &lt;p:dataTable lazy="true";liveScroll="true">的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆