The listener is triggered for the p:selectBooleanButton in parent ui:repeat, but the listener for p:selectBooleanButton is not triggered for the inner/child ui:repeat.
We cannot use nested forms. Any suggestions.
<h:form prependId="false">
<ui:repeat value="#{xBean.sectionsList}" var="sectionItem">
<p:fieldset>
<p:selectBooleanButton onLabel="ON" offLabel="OFF" value="#{sectionItem.checked}">
<p:ajax listener="#{xBean.selectSection}"/>
</p:selectBooleanButton> :
<ui:repeat value="#{sectionItem.sectionOptionsList}" var="sectionOptionItem">
<p:selectBooleanButton onLabel="ON" offLabel="OFF" value="#{sectionOptionItem.checked}">
<p:ajax listener="#{xBean.selectSectionOption}"/>
</p:selectBooleanButton>
</ui:repeat>
</p:fieldset>
</ui:repeat>
</h:form>
The <ui:repeat>
is a view render time tag. Thus, it's physically present in the JSF component tree and generates its HTML output as many times as it needs to iterate over the value.
In other words, they(p:selectBooleanButton) needs to be prepared during the view build time instead of the view render time.
The JSTL <c:forEach>
is a view build time tag. It will generate physically multiple components into the JSF component tree.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With