1 Reply Latest reply on Jul 29, 2010 4:11 AM by ilya_shaikovsky

    reRender in selectOneRadio show or hide

    sam_pc1611

      hello everybody, here is something that i think someone could need it!!!!

       

      I have a selectOneRadio whit a onclick event and one action, the first code go to the action and reRender outTst,outTst2, in the first id the value is

      TRUE-FALSE-FALSE  so i hope  rendered with id="outTst2"  is rendered, but its not!!!!!

       

      <h:selectOneRadio  value="#{ClientAddBean.cliPersonType}" >
                         <f:selectItems value="#{ClientAddBean.cliPersonTypeLst}"/>
                        <a4j:support event="onclick"  action="#{ClientAddBean.SelectRadio}" reRender="outTst,outTst2 "></a4j:support>
      </h:selectOneRadio>
                      

      <h:outputText id="outTst"  value="#{ExistBean.clientFis}-#{ExistBean.clientEmp}-#{ExistBean.clientMor}"></h:outputText>

      <h:outputText id="outTst2" value="here am i" rendered="#{ExistBean.clientFis}" ></h:outputText>

       

      NOW if we put the rendered inside of outputPanel and we do the reRender to this, we get the rendered show or hide

       

      <h:selectOneRadio  value="#{ClientAddBean.cliPersonType}" >
                               <f:selectItems value="#{ClientAddBean.cliPersonTypeLst}"/>
                               <a4j:support event="onclick" action="#{ClientAddBean.SelectRadio}" reRender="outTst, outPanel"></a4j:support>
      </h:selectOneRadio>
      <h:outputText id="outTst" value="#{ExistBean.clientFis}-#{ExistBean.clientEmp}-#{ExistBean.clientMor}"></h:outputText>
      <a4j:outputPanel id="outPanel">
          <h:outputText value="here am i" rendered="#{ExistBean.clientFis}" ></h:outputText>
      </a4j:outputPanel>

       

      I HOPE I HAVE BEEN VERY HELPFUL,,,, CHEERS!!!!!!!

        • 1. Re: reRender in selectOneRadio show or hide
          ilya_shaikovsky

          thanks for sharing any usefull info you have. But this alsready included into dev guide as limitation and mentioned in the FAQ. Elements could not be inserted via ajax - but could be only updated. So conditionally rendered elements should be updated only using parent update.