Search code examples
jsfrichfacesrichfaces-modal

Render rich: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>

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).

Flow

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

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

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.

Platform

  • RichFaces: 4.2.2.Final
  • Spring: 3.1.1.RELEASE

Cheers


Solution

  • 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.