3 Replies Latest reply on Sep 26, 2007 8:48 AM by powerhouse_b

    problem with h:selectBooleanCheckbox and a4j:support

    powerhouse_b

      Hello.

      The fallowing code does not refresh the value of the boolean value "trusted" in my backing bean. I have put an System.out.println in the setter to know when it is being called. but this never happens. Only the getter is called and it returns corectly. This is the code:

      <h:selectBooleanCheckbox id="chkTrusted" value="#{loginBean.trusted}" >
       <a4j:support event="onchange" />
      </h:selectBooleanCheckbox>
      


      I have also tried (i included all superior tags)
      <f:view>
      //....
      <rich:panel style="width:435px ">
      //...
       <h:form>
      //...
       <h:panelGrid>
       <a4j:outputPanel id="checkboxPanel" >
       <h:selectBooleanCheckbox id="chkTrusted" value="#{loginBean.trusted}" >
       <a4j:support event="onchange" reRender="checkboxPanel"/>
       </h:selectBooleanCheckbox>
       </a4j:outputPanel>
      //...
      




        • 1. Re: problem with h:selectBooleanCheckbox and a4j:support
          ilya_shaikovsky

          1) outputPanel is not a component that change processing.

          2) If the setter isn't called - place rich:messages somewhere or use phasetracker to check where the processing breaks from server logs.

          • 2. Re: problem with h:selectBooleanCheckbox and a4j:support
            powerhouse_b

            This is my output with phasatracker. I wrote an System.out.println in every getter and setter, so when you see something begining with "setting" or "getting", it is from me. I see the null parameter ERROR, but i don't know where it might come from.

            BEFORE RESTORE_VIEW 1
            AFTER RESTORE_VIEW 1
            BEFORE RENDER_RESPONSE 6
            setting login buton
            null parameter ERROR
            getting isTrusted
            getting username
            getting password
            AFTER RENDER_RESPONSE 6
            BEFORE RESTORE_VIEW 1
            BEFORE RENDER_RESPONSE 6
            BEFORE RESTORE_VIEW 1
            BEFORE RENDER_RESPONSE 6
            BEFORE RESTORE_VIEW 1
            setting login buton
            AFTER RESTORE_VIEW 1
            BEFORE APPLY_REQUEST_VALUES 2
            AFTER APPLY_REQUEST_VALUES 2
            BEFORE PROCESS_VALIDATIONS 3
            AFTER PROCESS_VALIDATIONS 3
            BEFORE UPDATE_MODEL_VALUES 4
            AFTER UPDATE_MODEL_VALUES 4
            BEFORE INVOKE_APPLICATION 5
            AFTER INVOKE_APPLICATION 5
            BEFORE RENDER_RESPONSE 6
            null parameter ERROR
            AFTER RENDER_RESPONSE 6

            • 3. Re: problem with h:selectBooleanCheckbox and a4j:support
              powerhouse_b

              Pls ignore the previous output, i forgot to put an System.out.println in the getter for the login button (it is binded to a UICommand).

              BEFORE RESTORE_VIEW 1
              AFTER RESTORE_VIEW 1
              BEFORE RENDER_RESPONSE 6
              getting login button
              setting login buton
              null parameter ERROR
              getting trusted
              getting username
              getting password
              AFTER RENDER_RESPONSE 6

              //know I press the check box hoping to change the variable "trusted" and this is the ouptut:

              BEFORE RESTORE_VIEW 1
              setting login buton
              AFTER RESTORE_VIEW 1
              BEFORE APPLY_REQUEST_VALUES 2
              AFTER APPLY_REQUEST_VALUES 2
              BEFORE PROCESS_VALIDATIONS 3
              AFTER PROCESS_VALIDATIONS 3
              BEFORE UPDATE_MODEL_VALUES 4
              AFTER UPDATE_MODEL_VALUES 4
              BEFORE INVOKE_APPLICATION 5
              AFTER INVOKE_APPLICATION 5
              BEFORE RENDER_RESPONSE 6
              null parameter ERROR
              AFTER RENDER_RESPONSE 6