Problem with confirm and back buttons in form
Hi, I've a strange problem with a jfs page.
I'm trying to insert some data in a DB.
My page had 2 textfields mandatory (required=true)
<h:panelGroup>
<h:form id="form_inserimento_areevaste" style="display: inline; padding: 0px; margin: 0px">
<h:panelGrid columns="3">
<h:outputText value="Code" />
<h:inputText value="#{areeVasteBean.current.id.t98IdAreavasta}" required="true" id="ins_cod">
<f:validateLength maximum="10" minimum="1" />
</h:inputText>
<h:message for="ins_cod" fatalClass="fatalStyle" errorClass="errorStyle" infoClass="infoStyle" warnClass="warnStyle"/>
<h:outputText value="Name" />
<h:inputText value="#{areeVasteBean.current.t98Nome}" required="true" id="ins_nome">
<f:validateLength maximum="255" minimum="1" />
</h:inputText>
<h:message for="ins_nome" fatalClass="fatalStyle" errorClass="errorStyle" infoClass="infoStyle" warnClass="warnStyle"/>
</h:panelGrid>
<a4j:commandButton action="#{areeVasteBean.add}" value="Save" reRender="tab_T98" ignoreDupResponses="true" requestDelay="400"/>
</h:form>
<h:outputText escape="false" value="<script> setFocus('form_inserimento_areevaste:ins_cod'); </script>"/>
<h:form style="display: inline; padding: 0px; margin: 0px">
<h:commandButton action="#{areeVasteBean.backAndRefresh}" value="Back" title="Back" />
</h:form>
</h:panelGroup>
This is the sequence:
go into the page for insert value and without fill any fields, click on Save.
The jsf notify me (using the <h:message>) that the textfields are mandatory.
Now I fill the textfields BUT click on "Back" button. The action that starts should be "areeVasteBean.backAndRefresh" instead starts the "areeVasteBean.add" (!?!)
What's happen? Can you help me?

