strange behavior with ajax4jsf in long-running conversation
courtneycouch May 15, 2008 5:15 AMI'm not sure if this is expected behavior, but when entering this:
<h:inputText value="#{memberExample.identifier}" id="referrerIdentifierField2"> <a:support event="onblur" reRender="repeater,referrerIdentifierField2" limitToList="true" bypassUpdates="false" /> </h:inputText>
outside of a long running conversation it works without a hitch. Updating the model and reRendering the necessary items.
Running inside of a long running conversation it only works correctly if I dont have it reRender itself.
To demonstrate this I have:
<h:inputText value="#{memberExample.identifier}" id="referrerIdentifierField2"> <a:support event="onblur" reRender="repeater,referrerIdentifierField2" limitToList="true" bypassUpdates="false" /> </h:inputText> <h:inputText value="#{memberExample.identifier}" id="referrerIdentifierField"> <a:support event="onblur" reRender="repeater" limitToList="true" bypassUpdates="false"/> </h:inputText> <h:outputText id="repeater" value="#{memberExample.communityIdentifier}"/>
In a long-running conversation and when typing into the first box, the model is not updated (and when rerendered the input box is blank after a blur and subsequent render). If using the second box, it updates the model and renders the repeater
fine.
The only difference is that the a:support tag does not try to reRender the field being submitted.
Since it works fine outside of a long-running conversation I assume there is something extra I need to do in order to reRender the form?
Another peculiar thing, I can have two fields bound to the same bean property, and have one re-render the other, the functionality only breaks on rerendering the field where the ajax call is resulting from.
In other words:
<h:inputText value="#{memberExample.identifier}" id="referrerIdentifierField2"> <a:support event="onblur" reRender="repeater,referrerIdentifierField2" limitToList="true" bypassUpdates="false" /> </h:inputText> <h:inputText value="#{memberExample.identifier}" id="referrerIdentifierField"> <a:support event="onblur" reRender="repeater,referrerIdentifierField2" limitToList="true" bypassUpdates="false"/> </h:inputText> <h:outputText id="repeater" value="#{memberExample.communityIdentifier}"/>
using that the first field will not update the model, but the second will.
-C