Why does a subTable break a4j:commandLink's reRender?

Posted by Tom on Stack Overflow See other posts from Stack Overflow or by Tom
Published on 2010-04-22T10:01:38Z Indexed on 2010/04/22 12:33 UTC
Read the original article Hit count: 401

Filed under:
|
|
|
|

Here is a minimal rich:dataTable example with an a4j:commandLink inside. When clicked, it sends an AJAX request to my bean and reRenders the dataTable.

<rich:dataTable id="dataTable" value="#{carManager.all}" var="item">
    <rich:column>
        <f:facet name="header">name</f:facet>
        <h:outputText value="#{item.name}" />
    </rich:column>
    <rich:column>
        <f:facet name="header">action</f:facet>
        <a4j:commandLink reRender="dataTable" value="Delete" action="#{carForm.delete}">
                <f:setPropertyActionListener value="#{item.id}" target="#{carForm.id}" />
                <f:param name="from" value="list" />
        </a4j:commandLink>
    </rich:column>
</rich:dataTable>

The exmaple obove works fine so far. But when I add a rich:subTable (grouping the cars by garage for example) to the table, reRendering fails...

<rich:dataTable id="dataTable" value="#{garageManager.all}" var="garage">
    <f:facet name="header">
        <rich:columnGroup>
            <rich:column>name</rich:column>
            <rich:column>action</rich:column>
        </rich:columnGroup>
    </f:facet>

    <rich:column colspan="2">
        <h:outputText value="#{garage.name}" />
    </rich:column>

    <rich:subTable value="#{garage.cars}" var="car">
        <rich:column><h:ouputText value="#{car.name}" /></rich:column>
        <rich:column>
            <a4j:commandLink reRender="dataTable" value="Delete" action="#{carForm.delete}">
                    <f:setPropertyActionListener value="#{item.id}" target="#{carForm.id}" />
                    <f:param name="from" value="list" />
            </a4j:commandLink>
        </rich:column>
    </rich:column>
</rich:dataTable>

Now the rich:dataTable is not rerendered but the item gets deleted since the item does not show up after a manual page refresh.

Why does subTable break support for reRender-ing here?

Tanks Tom

© Stack Overflow or respective owner

Related posts about richfaces

Related posts about a4j