2 Replies Latest reply on Mar 10, 2014 3:46 PM by wish79

    Reset input on page

    wish79

      Hello All,

      i have an input in my screen and i have a button that reset the backing bean, the problem when i press the button i called an action methos that reset the bean , and the button render the form .

       

      the problem the input field still has the old value , i checked it in backing bean it is null but on the screen has value .

       

      the backing bean is view scope , and i tried h:commandbutton same problem .

       

      How i have to reset the page which is Viewscope ?

        • 1. Re: Rest input on page
          michpetrov

          Hi,

           

          I assume your code looks like this:

          <h:inputText id="text" value="#{bean.text}" />
          
          <a4j:commandButton action="#{bean.reset}" render="text" value="Reset" />
          

           

          Rendering the input components directly does not work, that's a JSF thing. You have to wrap the input in something (<a4j:outputPanel> for example) and then render the wrapping component.

          • 2. Re: Rest input on page
            wish79

            i solved my problem by add execute="inputid" on the command button