Question

I am having issues with JSF/ADF/PPR on refreshing the page incorrectly. I have a selectManyCheckBox with 5 options in it, one of the option is 'All'. If users check that checkbox, I should check all the others.

<h:panelGrid styleClass="myBox leftAligned" id="applyChangesBox">
            <af:selectManyCheckbox id="changesCheckedBox" 
                   autoSubmit="true" label="Hello: "
                   value="#{updateForm.applyChangesList}" 
                   valueChangeListener="#{updateForm.testValueChanged}">
              <af:selectItem value="A" label="All Changes"/>
              <af:selectItem value="R" label="Residential Address"/>
              <af:selectItem value="M" label="Mailing Address"/>
              <af:selectItem value="P" label="Personal Phone/Fax Numbers"/>
              <af:selectItem value="E" label="Personal Email Addresses"/>
            </af:selectManyCheckbox>
            <af:outputText value="#{updateForm.testValue}" partialTriggers="changesCheckedBox"/>
          </h:panelGrid>

I am using valueChangeListener so that I can see my bean updated and printed out correctly, but my page does not refresh and check all the other checkbox if I need to.

Was it helpful?

Solution

Try the following:

  1. Don't use the valueChangeListener. Move your logic to the setApplyChangesList() method on your bean.
  2. Add partialTriggers="changesCheckedBox" to the the select one choice.
  3. OR replace the <h:panelGrid/> with an ADF component & set the partialTriggers attribute on it so that it isn't on the selectManyCheckbox & outputText

OR

Replace the selectManyCheckbox with selectManyList & use the selectAllVisible attribute which seems to do what you want.

These new cheatsheets are great! http://www.oracle.com/technology/products/adf/adffaces/11/doc/cheatsheet/lovs.html

OTHER TIPS

I know the question is very old, but maybe others still have this problem. It's better to put the partialTrigger on the parent of the rather than on the output itself. This way, the parent panel is repainted, together with the output. Secondly, it's a good idea to set the "id" field of the components that should respond to triggers.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top