Ok, I have something like this:
<a4j:form ignoreDupResponses="true">
<rich:tabPanel switchType="ajax" immediate="true" id="panelId">
<rich:tab label="Name" name="NAME" action="#{bean.clearData()}">
<h:inputText value="#{bean.value1}" required="true"/>
<h:inputText value="#{bean.value2}" required="true"/>
<rich:messages/>
<a4j:commandButton action="#{bean.someAction()}" value="OK"
reRender="panelId" />
</rich:tab>
<rich:tab label="Name2" name="NAME2">
<!-- Some content -->
</rich:tab>
</rich:tabPanel>
</a4j:form>
bean.someAction()
is a function that saves in my DB value1
and value2
.
bean.clearData()
is a function that clears value1
and value2
from by bean, or loads it if it is already saved in the DB.
Here is my problem... When I type value1
some value, and then I leave value2
blank, I will get some messages printed in <rich:messages/>
.
Then I switch to the tab "Name2", and after that I return to the tab "Name1", the webpage will show the old value for any <h:inputText/>
, since I executed bean.clearData()
the values are empty in my bean and in they are not even in the conversation.
edit: my form retains the data and does not clear it, even when it is not inside the bean anymore.
All I can think of is the browser cache'ing the data, and I want to avoid the data to load when it is not saved in my DB. Does anyone have an idea of how to fix this? I have tried autocomplete="off" in the h:inputText with no results.
PS: using FireFox 12.0