0

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

<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显示为空(它已呈现但显示为空,见下图)。

流动

如果我在extendedDataTable之前添加一个空白,问题就解决了popup,如下所示:

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

rich:dataTable问题不存在,但我需要一个extendedDataTable.

并且额外的异常行为是当我调整浏览器大小时,数据会出现。

平台

  • RichFaces:4.2.2.Final
  • 春天:3.1.1.RELEASE

干杯

4

2 回答 2

2

使用onclick而不是oncomplete. ExtendedDataTable无法在不可见元素中正确渲染(这是一个错误),因此popupPanel必须在重新渲染之前使其可见。

于 2014-02-20T12:55:16.847 回答
1

我有同样的问题。

我以非 100%richface 正确的方式解决了它:

<a4j:commandButton 
  value="show"
  action="#{actionForm.setShowEditor('true')}"
  oncomplete="javascript:location.reload(true)"/>

<a4j:region layout="block" rendered="#{actionForm.showEditor}" id="panelArea">
   <rich:popupPanel id="#{popupID}" modal="true" show="true" domElementAttachment="parent">
   ....
   tabel
   buttons
   ....
   </rich:popupPanel>
</a4j:region>

弹出窗口始终显示在 a4j:region 内 (show="true")。但是 a4j:region 仅在变量显示 popup = true 时才显示。

在我的情况下需要刷新整页,否则我的 ckeditor 会出现一些初始化错误。如果在设置“#{actionForm.setShowEditor('true')} 后仅重新渲染 a4j:region ,它也应该工作。

于 2014-02-20T09:46:31.420 回答