0

I had p:selectOneRadio which contains two choices, according to that choice I had to show and hide some other components which are rendered to the p:selectOneRadio selected value.So I have to update those components in the click event of the p:selectOneRadio and exactly what I did but nothing is updated, seems I miss something, am using Primefaces 3.6. Here is my code.

<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>
Aritz
  • 30,971
  • 16
  • 136
  • 217
Islam
  • 1,647
  • 6
  • 27
  • 40
  • 2
    Primefaces 3.6 does not exist as far as I know! Appart from that, p:ajax accepts multiple components to update, separated by commas or white spaces. – Aritz Oct 02 '13 at 09:53
  • possible duplicate of [JSF(Primefaces) ajax update of several elements by ID's](http://stackoverflow.com/questions/4474789/jsfprimefaces-ajax-update-of-several-elements-by-ids) – Aritz Oct 02 '13 at 09:54
  • @XtremeBiker it do exists http://grepcode.com/snapshot/repository.primefaces.org/org.primefaces/primefaces/3.6-20130218.085449-3 also you can look at the showcase you will find that it uses primefaces 4.0 – Islam Oct 02 '13 at 09:57
  • and the I followed the link you show me before but this solution doesn't work for me, so i posted my code to find if I missed something – Islam Oct 02 '13 at 10:02
  • 1
    The link you provided relates to an external source. Check [PF repo](http://repository.primefaces.org/org/primefaces/primefaces/) or [download page](http://primefaces.org/downloads.html). – Aritz Oct 02 '13 at 10:02
  • You cannot update components you want to show directly. Nest them in a container. Here you have a [clue](http://stackoverflow.com/questions/9010734/why-do-i-need-to-nest-a-component-with-rendered-some-in-another-component-w). – Aritz Oct 02 '13 at 10:06
  • I have done it and append the form name to the component name and still nothing updated – Islam Oct 02 '13 at 10:15
  • Apparently there was a 3.6 version, after reintegrated in 4.0-SNAPSHOT, as [it seems](http://blog.primefaces.org/?p=2498). If your project is for production purposes I encourage you going with 3.5 before 4.0 FINAL is released. – Aritz Oct 02 '13 at 10:16
  • that exactly what I did, but still the same problem – Islam Oct 02 '13 at 10:18

0 Answers0