I'm dynamically generating a #{materielBean2.nbrsalle}
amount of dropdowns:
<c:forEach begin="1" end="#{materielBean2.nbrsalle}" var="i">
<p:selectOneMenu id="p#{i}" value="#{materielBean2.pole}">
<f:selectItem itemLabel="Select Pole" itemValue="" />
<f:selectItems value="#{materielBean2.poles}" />
<p:ajax event="change" update="s#{i}" listener="#{materielBean2.salleChange(i)}" />
</p:selectOneMenu>
</c:forEach>
I have a Map<String, String>
property where I'd like to save the selected values.
private Map<String, String> selectedPoles = new HashMap<String, String>();
The ajax change listener method is as follows:
public void sallechange(int i) {
selectedPoles.put(i, pole);
}
How do I get the selected pole
value of index i
in the listener method?