5
我正在使用p:selectOneRadio
與p:ajax
和另一個組件(p:inputText
)的值,未綁定其值在我的bean中。p:selectOneRadio不更新事件「更改」中的模型與p:ajax
如果我使用p:selectBooleanCheckbox
而不是我所需要的行爲,請在調用ajax中的方法之前更新bean。這是p:selectOneRadio
中的錯誤還是這是它的默認行爲?
我使用JSF2,PrimeFaces 4
的XHTML代碼:
<p:selectOneRadio id="enumId" value="#{xyzController.entity.enumValor}"
disabled="#{disabled}" required="true" plain="true">
<f:selectItems value="#{xyzController.enum}" var="item"
itemLabel="#{messages[ELUtils.evaluateExpression(itemLabelEL)]}"
itemValue="#{item}" />
<p:ajax event="change" listener="#{xyzController.aoTrocar}"
update="panelDominioFields" process="@form" />
</p:selectOneRadio>
<p:outputPanel layout="inline" id="panelDominioFields">
<p:inputText id="valorId"
value="#{xyzController.entity.valorNumericoValido}"
rendered="#{xyzController.mostrarCampoDominioNumerico}"
required="true">
<f:convertNumber type="number" locale="#{localeController.locale}"
currencyCode="#{localeController.currencyCode}" />
</p:inputText>
</p:outputPanel>