< 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">

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

问题描述

我正在将JSF 2.2与PrimeFaces 4.0一起使用.我有一个 <p:dataTable> 延迟加载行扩展单元格编辑等.

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="display: none;"></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.

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

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天全站免登陆