tags:

views:

332

answers:

1

Hi, 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.

A: 

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

Wayne Young
It is not quite what I am looking yet, but it works.
Nhut Le