Search code examples
jsfjakarta-eejsf-2jstlicefaces

Can't rerender component which is bulilt through foreach


i have a div which consists of set of checkboxes built through foreach as follows:

<ice:panelGroup id="myDiv">

    <c:forEach items="#{myBean.myCheckBoxes}" var="entry" varStatus="loop">                             

        <input type="checkbox" name="myCheckBoxes" value="#{entry.value}" />
        <span class="#{fn:contains(entry.value,'g') ? 'bold-style' : ''}">#{entry.key}</span>
    </c:forEach>

</ice:panelGroup>

and i have an icefaces button in the same form of that div, and the button makes partial submit, i don't want to make full form submit.

<ice:commandButton value="Find"  action="#{myBean.find}" partialSubmit="true">
    <f:ajax execute="@this" render="myDiv" />
</ice:commandButton>

the search method:

public void find() {
   // changes the map of the iteration
}

what happens, is that after executing search some components doesn't get removed from the div, although that they are not in the map, guess that the div is not getting refreshed/populated with data correctly, please advise, thanks.


Solution

  • solved by using ui:repeat instead of foreach.