开发者

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" />
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜