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:
- Don't use the
valueChangeListener
. Move your logic to thesetApplyChangesList()
method on your bean. - Add
partialTriggers="changesCheckedBox"
to the the select one choice. - OR replace the
<h:panelGrid/>
with an ADF component & set thepartialTriggers
attribute on it so that it isn't on theselectManyCheckbox
&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.
精彩评论