我有p:selectOneRadio,其中包含两个选项,根据该选项,我必须显示并隐藏一些其他组件,这些组件将呈现给p:selectOneRadio选择的值。所以我必须在click事件中更新这些组件。 p:selectOneRadio,正是我所做的,但没有更新,似乎我想念一些东西,使用的是Primefaces 3.6。这是我的代码。
<tr>
<td>
<p:outputLabel id="newOriginalValDataSource" value="Original Value Datasource" rendered="#{addConditionBean.newCondition.conditionComplexityLevel eq 1 }" />
</td>
<td>
<p:selectOneRadio id="newOriginalValueDSRadio" style="border: white;" value="#{addConditionBean.newCondition.usedParamId}" rendered="#{addConditionBean.newCondition.conditionComplexityLevel eq 1 }">
<f:selectItems value="#{addConditionBean.usedParameterTypes}" var="used" itemLabel="#{used.lookupValue}" itemValue="#{used.lookupId}"/>
<p:ajax global="false" process="@this" update="newParameterNameDDLLabel newOriginalValueParameterLbl newParameterNameDDL newOriginalValueFormulaChoice" event="click"/>
</p:selectOneRadio>
</td>
</tr>
<tr>
<td>
<p:outputLabel rendered="#{addConditionBean.newCondition.conditionComplexityLevel eq 1 and (addConditionBean.newCondition.usedParamId eq 1 or addConditionBean.newCondition.usedParamId eq null)}" id="newParameterNameDDLLabel" value="Original Value Parameter :"/>
<p:outputLabel rendered="#{addConditionBean.newCondition.conditionComplexityLevel eq 1 and addConditionBean.newCondition.usedParamId eq 2}" id="newOriginalValueParameterLbl" value="Original Value Formula :" />
</td>
<td>
<h:selectOneMenu id="newParameterNameDDL" rendered="#{addConditionBean.newCondition.conditionComplexityLevel eq 1 and (addConditionBean.newCondition.usedParamId eq 1 or addConditionBean.newCondition.usedParamId eq null)}" value="#{addConditionBean.newCondition.conditionParameterId}">
<f:selectItem itemLabel="--Select Parameter--" itemValue="#{addConditionBean.defaultDropDownValue}"/>
<f:selectItems value="#{wFDesignBean.parameterDef}" var="conditionParamName" itemValue="#{conditionParamName.parameter_ID}" itemLabel="#{conditionParamName.parameter_Name}"/>
<p:ajax global="false" event="change"/>
</h:selectOneMenu>
<h:selectOneMenu id="newOriginalValueFormulaChoice" value="#{addConditionBean.newCondition.formulaId}" rendered="#{addConditionBean.newCondition.conditionComplexityLevel eq 1 and addConditionBean.newCondition.usedParamId eq 2}">
<f:selectItem itemLabel="--Select Fromula--" itemValue="#{addConditionBean.defaultDropDownValue}"/>
<f:selectItems value="#{addConditionBean.lkFormulas}" var="formulalk" itemValue="#{formulalk.lookupId}" itemLabel="#{formulalk.lookupValue}"/>
<p:ajax global="false" event="change" />
</h:selectOneMenu>
</td>
</tr>