2 Replies Latest reply on May 28, 2008 10:49 PM by pagaluisseam

    reset a form after a submit

    pagaluisseam

      Hi,
      i have an a4j form tag with some inputtext fields and rich:calendar tag.
      The field's values are retrieved from a bean in outjection .
      When i click on a command reset button i invoke a a method, which clear and initialize my bean, but in the form i always see the values inserted before.
      I'm not able to reset the input fields.


      Seems that richfaces has a memory of the values iunserted by th e user.


        • 1. Re: reset a form after a submit
          davidatkinsuk

          I think you may need to post some of your code for us to help.  From what you've said the richfaces value should be resetting.  Is the reset method being called in a 'proper' http request (GET/POS) or is it an ajax call? If it's an ajax call it may that your fields are not being correctly refreshed.

          • 2. Re: reset a form after a submit
            pagaluisseam

            Hi,
            in my xhtml i use:
            a form tag: <a4j:form id="#{idManager.getId('consumoFissoDetailPanelMainForm')}" ajaxSubmit="true" reRender="ConsumiFissiListPanelDataTable" >
            
            a coomand reset button 
            <a4j:commandButton align="right" id="#{idManager.getId()}" styleClass="button_blu" value="#{messages['consumiFissiListPanel.annulla']}"  action="#{consumiFissiManagementPanelAction.inizializeConsumoFisso()}" reRender="formFieldDataInizio,consumo-fisso-detail-panel-panel" type="reset" immediate="true" />  
            
            a slect list tag
            <h:selectOneListbox value="#{consumoFissoSelected.valoreConsumo}" size="1">                                                           <f:selectItems value="#{consumoFissoSelected.listaValoriAnnuali}"/>
            </h:selectOneListbox>
             an input text
                                                                            <h:inputText id="formFieldIdOperazioneConsumoFisso" readonly="true" value="#{consumoFissoSelected.idOperazioneConsumoFisso}" />
            
            
            The readonly input text is reset, while the select item is non reset||