Search code examples
jsfprimefacesselectoneradioajax-update

Ajax event change doesn't work


I've a form, and i want it to show some inputs only if the user mark yes on a selectOneRadio.

Here is the code:

<p:selectOneRadio id="someSelectRadio" value="#{someBean.someClass.someSelectRadio}" >
                        <f:selectItem itemLabel="Sim" itemValue="Sim" />
                        <f:selectItem itemLabel="Não" itemValue="Não" />

//Here i use event=change to reconize if the user mark a option on selectOneRadio
<p:ajax  event="change" process="someSelectRadio" update="panelGeral" />  
                    </p:selectOneRadio>
 //Here is the panel that i want to appear if the user mark selectOneRadio
<p:outputPanel id="panelGeral">
                      <p:panel id="panel" autoUpdate="true" rendered="#{someBean.someClass.someMethod}" />   

                    </p:outputPanel>

I already have tryied to change event do click, on click, both doesn't work for me.


Solution

  • This may be due to the problem with event . Change to

    <p:ajax  event="valueChange" process="someSelectRadio" update="panelGeral" />  
    

    More info