ajaxRendered VS reRender

<a4j:outputPanel ajaxRendered=”true”>
<h:messages />
</a4j:outputPanel>

“limitToList” attribute allows to dismiss the behavior of the <a4j:outputPanel> “ajaxRendered”
attribute. “limitToList” = “false” means to update only the area(s) that mentioned in the “reRender”
attribute explicitly. All output panels with “ajaxRendered”=”true”is ignored. An example is placed
below:

<h:form>
<h:inputText value=”#{person.name}”>
<a4j:support event=”onkeyup” reRender=”test” limitToList=”true”/>
</h:inputText>
<h:outputText value=”#{person.name}” id=”test”/>
</form>

Demonstration :

<body>

<f:view>
<h:form>

This value Will Render ‘X’ and ‘Y’ : <h:inputText value=”#{bean.text}”>
<a4j:support event=”onkeyup” reRender=”y” ajaxSingle=”true”></a4j:support>
</h:inputText>
<br />
This value Will Render only ‘X’ : <h:inputText value=”#{bean.text}”>
<a4j:support event=”onkeyup” reRender=”y” ajaxSingle=”true” limitToList=”true”></a4j:support>
</h:inputText>
<br />

<a4j:outputPanel ajaxRendered=”true”>Return By Ajax <br/>X : <h:outputText id=”x” value=”#{bean.text}”></h:outputText></a4j:outputPanel>

<br />
Return By Ajax <br/>Y : <h:inputText id=”y” value=”#{bean.text}”></h:inputText>
</h:form>
</f:view>
</body>

~ by Fahmi on July 7, 2008.

One Response to “ajaxRendered VS reRender”

  1. good post.
    Is my solution for a work day going crazy!!

    thanks!

Leave a Reply