I need to display categories dynamically using the combination of ui:repeat and selectManyCheckbox. At this moment the code snippet below renders the categories properly and when the user selects the categories it sets the values correctly.
The issue I'm seeing is when I set the code that allows the user to manually collapse a p:fieldset. Let say there are 3 categories (A,B,C), if the user selects and collapses category C. The only backing bean that gets called is category C and the flag that I use does get set. The problem that I see is that ALL categories end up being collapsed when the ajax call updates the screen. If the user collapses/opens any other category all categories end up being affected. I have tried to debug this behavior and I see that the banking bean always gets the right value but the component behaves incorrectly. I tested this with Mojarra and Myfaces 2.2.10 both showed the same behavior.
Code: Select all
<ui:repeat value="#{controller.categories}" var="category">
<p:fieldset legend="#{category.name]}" toggleable="true" toggleSpeed="500" collapsed="#{category.collapsed}" >
<p:ajax event="toggle" listener="#{category.handleToggle}" process="@this" update="@form"/>
<p:selectManyCheckbox rendered="#{category.type==1}" layout="responsive" columns="3" value="#{category.selected}" converter="categoryConverter">
<f:selectItems value="#{category.value}" var="keyword" itemLabel="#{keyword.code}" itemValue="#{keyword}" />
</p:selectManyCheckbox>
</p:fieldset>
</ui:repeat>