我的xhtml
#{seating.cntPLayersInRow} <!--This looks great, is same like in BackingBean-->
<h:form>
<ui:repeat value="#{seating.cntPLayersInRow}" var="cntInRow" >
<p:spinner value="#{cntInRow}" > <!--Here is the Problem the value never actualize -->
</p:spinner>
</ui:repeat>
<h:commandButton value="přidat řadu" action="#{seating.addRow()}" />
</h:form>
我的方法addRow在backingBean中:
public String addRow() { //I Think not very import just change all value and add one
cntRow++;
cntPLayersInRow.clear();
for (int i = 1; i < cntRow; i++) {
cntPLayersInRow.add(someNumber/cntRow);
}
cntPLayersInRow.add(someNumber/cntRow+someNumber%cntRow);
return null;
}
cntPlayersInRow是整数的ArrayList
问题是当在BackinBean中实现cntPlayerInRow时,p:spinner中的值不实现(范围是ViewScope)
抱歉我的英文。