ui:在Backing Bean中更改之后,repeat没有实现内部元素(p:spinner)

时间:2013-04-09 14:53:18

标签: jsf-2 primefaces

我的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)

抱歉我的英文。

0 个答案:

没有答案