richfacesrenderajax4jsf

RichFaces 3 & AJAX request - Bean updated but not the page if not first Ajax request


Inside a rich:dataTable I have one column header with the following input which is a filter:

<h:inputText id="filter" value="#{action.filter}">
    <a4j:support event="onkeyup" requestDelay="1000" ignoreDupResponses="true" 
                 reRender="dataTable, filter" 
                 focus="filter" oncomplete="setCaretToEnd(event);" />
</h:inputText>

My page contains some other components with ajax. Everything is inside a h:form and there is no aj4:region (if it is relevant to notice).

When the page is loaded, if the first sent AJAX request is the one from the filter input, it works fine and my table is correctly updated. Nonetheless as soon as an other AJAX request is sent before, the bean is still correctly updated with the new values that should populate my table, but nothing changes in my page, as if the reRender attribute is not working.

This issue only applies to this particular input and AJAX request. All other components work fine at any moment.

I am pretty new to JSF and RichFaces. Maybe it is related to queues?


Solution

  • I solved the problem. I just nested my deficient component inside the following panel :

    <a4j:outputPanel ajaxRendered="true">
    

    The RichFaces documentation says :

    A component with ajaxRendered="true" will be re-rendered with every Ajax request, even when not referenced by the requesting component's render attribute. This can be useful for updating a status display or error message without explicitly requesting it.

    So I guess that it just like if I was forcing the reRender attribute of my nested component to work no matter what. Weird though.