2

I try to re-render a <t:selectManyCheckbox layout="spread">. However, it does not re-render.

The Ajax call:

    <h:selectBooleanCheckbox value="#{handler.property}">
        <f:ajax listener="#{handler.toggleItems}" render="items" />
    </h:selectBooleanCheckbox>

The t:selectManyCheckbox:

<t:selectManyCheckbox id="items" layout="spread" forceId="true"
        forceIdIndex="false" value="#{handler.selectedItems}"
        required="true">
        ....
</t:selectManyCheckbox>

The listener is called and new values for the <t:selectManyCheckbox> are set, but it does not re-render.

Any ideas why? I tried render="myForm:items" and render=":myForm:items" too. It's in the same form.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
geeehhdaa
  • 822
  • 5
  • 17
  • 30

1 Answers1

2

You need to re-render the spreaded <t:checkbox> items as well. I'd suggest to re-render the common parent of the <t:selectManyCheckbox> and all <t:checkbox> items. If not present, put them in a <h:panelGroup>.

E.g.

<h:panelGroup id="allCheckboxes">
    <t:selectManyCheckbox id="items" layout="spread" ... />
    ...
    <t:checkbox for="items" index="0" />
    ...
    <t:checkbox for="items" index="1" />
    ...
</h:panelGroup>

with

<f:ajax render="allCheckboxes" />
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555