0

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

Goodwine
  • 1,658
  • 1
  • 18
  • 31

2 Answers2

1

did you try a reRender="panelId" within your <a4j:form>?

Korgen
  • 5,191
  • 1
  • 29
  • 43
  • I added it and it seems to work, but I find it ridiculous to reRender the form each time I switch tabs after a submit to avoid this problem which seems to be caused due to the browser's autocomplete. I know that if the user's don't like this, they could disable it, but some of them barely know how to turn on a PC – Goodwine Jun 06 '12 at 03:08
0

in browser settings give clear history, cookies, cache, etc automatically.
I think then it will work.

Addicted
  • 1,694
  • 1
  • 16
  • 24