2 Replies Latest reply on Oct 8, 2010 10:12 AM by Kto ToTaki

    rich:graphValidator, profiles and death commandButton

    Kto ToTaki Newbie


      The question concerning use of rich:graphValidator and profiles and strange behavior when a4j:commandButton value="Previous" and "Next" stops  to work after 4,5 times of work.

          Using RF : 3.3.3Final


         The code first:

          The main part of the page "hovedSide" shows pages controlled by sideKontrollBean


          <ui:define name="body">   

              <a4j:outputPanel id="hovedSide" layout="block">       

                   <ui:insert name="side">

                       <ui:include src="#{sideKontrollBean.sideSomSkalVises}.xhtml" />






         Where included page looks like this:


          <rich:panel header="#{soknadWizardSide3.sideInfo.sideTopNavn}" >

              <h:form styleClass="yform" id="passWizardSide3Form" >

                  <rich:graphValidator profiles="#{valideringBean.valideringsProfil}">      

                      <fieldset class="columnar">


                          <rich:message for="hoyde4" styleClass="error_inline" showSummary="true" showDetail="false" id="hoyde4Feil"/>

                          <div class="type-text">

                              <label for="hoyde4" class="obligatorisk">#{txt.lbl_height}</label>

                              <h:inputText id="hoyde4"  value="#{bean.hoyde4}" />





                  <ui:include src="passWizardTaster.xhtml" />




          where hoyde4 in bean is defined as:


          @NotEmpty(groups = NesteWizardSide.class, message = "hoyde4 is mandatory")

          private String hoyde4;


          and passWizardTaster.xhtml looks like:

         <div class="type-button">

              <!-- Previous button should NOT perform any validation, see valideringsProfil.clear()  -->

              <a4j:commandButton value="Previous"   actionListener="#{soknadWizardBean.goTilForrigeSide}" reRender="hovedSide" >

                  <a4j:support immediate="true" event="onclick" actionListener="#{valideringBean.brukDefaultValideringsProfil}"/>



              <!-- Next button should perform validation using groups = NesteWizardSide.class -->

              <a4j:commandButton value="Next"  actionListener="#{soknadWizardBean.goTilNesteSide}" reRender="rfMessages, hovedSide" >

                  <a4j:support immediate="true" event="onclick" actionListener="#{valideringBean.brukNesteWizardSideValideringsProfil}"/>




         and in the end valideringBean 




          public class ValideringBean implements Serializable {


              private final Set<String> valideringsProfil = new HashSet<String>();


              public Set<String> getValideringsProfil() {

                  return valideringsProfil;



              public void brukDefaultValideringsProfil(javax.faces.event.ActionEvent e) {




              public void brukNesteWizardSideValideringsProfil(javax.faces.event.ActionEvent e) {








          The problem:


          Validation works as expected.

          Next button use a4j:support immediate="true" event="onclick" to set valideringsProfil to NesteWizardSide.class.getName(),

          before actionListener fires, which inform page to use choosen profile using <rich:graphValidator profiles="#{valideringBean.valideringsProfil}">      



          If user use Next, Previos buttons som times, may vary between 4-6 times, a4j:commandButton stops to perform actionListener event.


          When I look at the a4j:log no errors comming up and log shows full request.

          Firebug shows 2 POST's each with a very short Response with Ajax-Update-Ids containing only rich:message filds.



          If you Reload in browser, a4j:commandButton begin to work again, and after some times the history repeat.


          If I take away <a4j:support immediate="true" .../>  from a4j:commandButton, everything works as normal!


          So, it's maybe another way to set up profile before getter on page is validated, before any actionListener is executed?