开发者

JSF/ADF/PPR can't refresh the page as expected

开发者 https://www.devze.com 2022-12-24 02:10 出处:网络
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

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 oth开发者_Go百科ers.

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


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消