我的 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>
我在 backingBean 中的 addRow 方法:
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
问题是当 cntPlayerInRow 在 BackinBean 中实现时 p:spinner 中的值没有实现(范围是 ViewScope)
对不起我的英语不好。