How to re-render a <t:selectManyCheckbox layout="spread">?
I try to re-render a <t:selectManyCheckbox layout="spread">
. Howeve开发者_开发知识库r, 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.
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" />
精彩评论