4 Replies Latest reply on Jan 20, 2012 4:00 AM by tomek.f

    Render component after validation form error.

    tomek.f

      Is it possible to render component after validation error? I have inputs whitch can be rendered with commandButton, but after validationError it doesnt want to be rendered. Is there any solution for that.

       

      I have already tried immediate="true" and execute="@this" and it doesnt work either. Any suggestions solutions?

       

      Richfaces 4.1 Final.

        • 1. Re: Render component after validation form error.
          sunkaram

          you can try

           

          <a4j:jsFunction name="renderInputs"                                                  render="input1,input2" />

           

          <a4j:commandButton id="submit"                                                  action="youraction" value="Submit"

          oncomplete="if(#{facesContext.validationFailed}){renderInputs();}

          • 2. Re: Render component after validation form error.
            tomek.f

            Doesn't help the issue is more related with: 

             

            Problem header

             

            http://livedemo.exadel.com/richfaces-local-value-demo/

             

            But the solutions there don't work either.

            • 3. Re: Render component after validation form error.
              sunkaram

              did you the solution from my post? It should work..

               

              oncomplete of ajax action request it checks for validation errors and calls javascript function renderInputs() which should render required components.

              • 4. Re: Render component after validation form error.
                tomek.f

                Yes I implemented your solution- it doesn't work.

                 

                But after refreshing the page like F5 it renders correctly!

                 

                 

                <h:form>

                ...

                <a4j:commandButton  value="New" execute="@this"  action="#{bean.resetPanel}" render="flightEdit"

                                                 oncomplete="renderInputs();">

                </a4j:commandButton> 

                 

                <a4j:jsFunction name="renderInputs" render="flightDestination" />

                ...

                </h:form>

                 

                Let me say it again:

                 

                The problem is oonly when there was validation error - then the component isn't rerendered. After submitting form without errors it is ok. Everything in one view state.