我想记住 c:forEach 循环中多个 h:selectOneMenu 组件的值。现在只记得 h:selectOneMenu 的最后一个值。我不知道会出现多少 h:selectOneMenu。
<h:panelGrid
id="wynik"
columns="2"
border="0"
cellpadding="2"
cellspacing="0"
rowClasses="jsfcrud_odd_row,jsfcrud_even_row"
rules="all"
style="border:solid 1px">
<h:outputText id="ns" value="Numer stanowiska"/>
<h:outputText id="kontr" value="Kontroler"/>
<c:forEach
var="stanowisko"
begin="1"
end="#{stojakiController.selected.iloscstanowisk}"
step="1">
<h:column>
<h:outputText value="#{stanowisko}"/>
</h:column>
<h:column>
<h:selectOneMenu
id="kontroler_#{stanowisko}"
value="#{wyposazenieStojakaController.selected.kontroler}"
title="#{bundle.CreateWyposazenieStojakaTitle_kontroler}"
required="true"
requiredMessage="#{bundle.CreateWyposazenieStojakaRequiredMessage_kontroler}">
<f:selectItems value="#{kontroleryController.itemsAvailableSelectOne}"/>
</h:selectOneMenu>
</h:column>
</c:forEach>
</h:panelGrid>