呈现丰富:extendedDataTable [英] Render rich:extendedDataTable

查看:56
本文介绍了呈现丰富:extendedDataTable的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个显示 rich:extendedDataTable rich:popup ,并且当用户按下按钮时,应该显示 popup ,并且必须重新渲染 extendedDataTable ,这是代码:

I need a rich:popup that shows a rich:extendedDataTable, and when the user presses a button, the popup should be shown, and the extendedDataTable must be re-rendered, here is the code:

<rich:popupPanel id="popupId" show="false" modal="true">
    <h:form>
        <rich:extendedDataTable
            value="#{bean.list}"
            var="item" rows="5" id="table">
            <rich:column>
                <h:outputLabel value="#{item}" />
            </rich:column>
        </rich:extendedDataTable>

        <a4j:commandButton value="x" immediate="true"
            oncomplete="#{rich:component('popupId')}.hide(); return false;"/>
    </h:form>

</rich:popupPanel>


<h:form>
    <a4j:commandButton value="show"
        oncomplete="#{rich:component('popupId')}.show(); return false;"
        render="table" immediate="true" />
</h:form>

我第一次按 show 效果很好,但是当我用 X 按钮关闭面板并再次按 show 时,按钮, extendedDataTable 显示为空(已呈现但显示为空,请参见下图).

The first time I press the show it works fine, but when I close the panel with the X button and press again the show button, the extendedDataTable appears empty (It's rendered but appear empty, see image below).

如果我在 popup 之前添加一个空的 extendedDataTable ,则此问题已解决,如下所示:

The problem is fixed if I add an empty extendedDataTable before the popup, like this:

<rich:extendedDataTable />
<rich:popupPanel>
     ...

使用 rich:dataTable 不会出现问题,但是我需要 extendedDataTable .

With rich:dataTable the problem doesn't exits, but I need a extendedDataTable.

其他极端行为是当我调整浏览器大小时,数据就会出现.

And aditional extrange behaviour is when I resize the browser, the data appears.

平台

  • RichFaces:4.2.2.最终版本
  • 春季:3.1.1.发布

欢呼

推荐答案

使用 onclick 代替 oncomplete . ExtendedDataTable 在不可见元素内部无法正确呈现(这是一个错误),因此必须在重新呈现之前使 popupPanel 可见.

Use onclick instead of oncomplete. ExtendedDataTable doesn't render properly inside invisible elements (it's a bug) so the popupPanel has to be made visible before the rerendering.

这篇关于呈现丰富:extendedDataTable的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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