Mutiple ComboBoxes using c:forEach
invincible_virus Nov 16, 2011 10:09 AMI want to create mutiple ComboBoxes from a Map containing label for the box as key and an object having [possible values, selected value] as Value (id=bundleItemDecoration).
This map is updated on value change of another ComboBox (id=bundleType).
Code works fine when rendered for the first time, but behaves wierd when re-rendered.
When I change the value in ComboBox (id=bundleType), Map is updated and labels (id=bundleItemDecoration) are displayed correctly on the Page but possible values in their corresponding ComboBoxes (id=bundleItemDecoration) are not changed.
Please help.
<s:decorate id="bundleTypeDecoration" template="../layout/edit.xhtml">
<ui:define name="label">Bundle Type:</ui:define>
<rich:comboBox id="bundleType" selectFirstOnUpdate="true"
converter="#{bundleCodeConverter}"
value="#{createBundle.bundleTypeSelectedCd}"
defaultLabel="Select Bundle Type"
required="true"
suggestionValues="#{context.bundleCategoryList}"
directInputSuggestions="true">
<a4j:support event="onchange"
action="#{bundleCategoryBillingDealList.setBillingDealRestrictions()}"
reRender="billingInfoDecoration, bundleItemDecoration, billingDealRender, createBundleErrors"
eventQueue="default" />
</rich:comboBox>
</s:decorate>
<s:decorate id="bundleItemDecoration">
<c:forEach var="bundleItem" items="#{createBundle.billingServIdDisplayNmSOList}">
<s:decorate id="#{bundleItem.key}#{createBundle.bundleTypeSelectedCd}" template="../layout/edit.xhtml">
<ui:define name="label">#{bundleItem.key}:</ui:define>
<rich:comboBox
selectFirstOnUpdate="true"
value="#{bundleItem.value.selectedSOName}"
defaultLabel="Select Service Offering"
required="false"
suggestionValues="#{bundleItem.value.soSuggestionList}"
directInputSuggestions="true">
</rich:comboBox>
</s:decorate>
</c:forEach>
</s:decorate>