title: JSF 2.0 - Ajax and Rendered Components
body: <p>I'm experiencing some problems when using the "rendered" attribute with ajax behavior. I'll paste the code so I think it will be a lot more clear:</p>
  
  <pre><code>&lt;h:selectOneMenu value="#{registrarVentaController.esCobroChequeString}"&gt;
    &lt;f:selectItem itemLabel="Efectivo" itemValue="false"/&gt;
    &lt;f:selectItem itemLabel="Cheque" itemValue="true"/&gt;
    &lt;f:ajax  execute="@this" render="@form"/&gt;
  &lt;/h:selectOneMenu&gt;
  
  &lt;h:panelGroup id="panelMonto"&gt;
      &lt;span&gt;Monto:&lt;/span&gt;
      &lt;h:inputText value="#{registrarVentaController.monto}" rendered="#{registrarVentaController.banCobroCheque}"/&gt;
      &lt;h:inputText value="#{registrarVentaController.monto}" rendered="#{not registrarVentaController.banCobroCheque}"/&gt;    
  &lt;/h:panelGroup&gt;
  </code></pre>
  
  <p>My <strong>"#{registrarVentaController}"</strong> is just a View Scoped JSF Managed Bean with appropiate setters/getters.</p>
  
  <p>This way it works, I mean, when user selects option "<strong>Efectivo</strong>", panelGroup "<strong>panelMonto</strong>" will get updated and we'll see the first inputText, and conversely when user selects option "<strong>Cheque</strong>" user will see the second inputText.</p>
  
  <p>For this approach I used "<strong>f:ajax</strong>" component where I updated the whole <strong>@form</strong> to get this behavior work and I just want to update panelGroup "<strong>panelMonto</strong>" (using render="panelMonto" It doesn't work at all (I even try with full scope resolution <strong>:formName:panelMonto</strong> with no result).</p>
  
  <p>I just want to have rendered work with ajax="idComponent" or similar behavior to show certain parts according what user have selected.</p>
  
  <p>Best Regards!</p>
  
  <p><strong>Note (One solution)</strong></p>
  
  <blockquote>
    <p>I managed to get a solution (taking as an input
    <a href="https://stackoverflow.com/questions/5906643/jsf-rendered-is-not-working">JSF rendered is not working</a>
    and a bit of myself). I've just moved to a new form the part that I'm
    interested in filtering according what user selected. This way I still
    use @form ajax's render and it will just render this new form (not the
    whole form as I was using!) Neverthless I'm still wondering if there
    is a solution to not used @form and just the component/s ID.</p>
  </blockquote>