我正在尝试向我的<p:ajax>
添加<p:inputText>
以更改我在单元格编辑器PrimeFaces中输入的初始数字,并且我希望输入显示在h:outputText
我的豆子
public void onValuechange(ValueChangeEvent event) {
Object oldValue = event.getOldValue();
Object newValue = event.getNewValue();
if (newValue != null && !newValue.equals(oldValue))
quantity = (int) newValue;
}
我的xhtml
<p:column id="tmp" headerText="Quantity Requested(click to edit)" style="width: 150px; text-align: center" >
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{openJob.quantity}" id="output" />
</f:facet>
<f:facet name="input">
<h:inputText id="modelInput" value="#{openJob.quantity}" style="width:96%">
<f:ajax event="change" listener="#{openJob.onValuechange}" immediate="true" resetValues="true" disabled="false" execute="modelIput" render="output" />
</h:inputText>
</f:facet>
</p:cellEditor>
</p:column>