3 Replies Latest reply on Nov 3, 2009 7:59 PM by Shervin Asgari

    Strange AJAX behavior

    Alex Cougarman Apprentice

      Hi. I've wired up some radio buttons to show/hide two Seam SPAN tags. Two issues exist:



      1. It takes a few seconds before it shows/hides the correct SPAN tag.

      2. When you submit and then click the back button on the browser and return to the page, the radio buttons have the correct value selected (the one the user chose), but the incorrect SPAN tag is showing. You have to select the other radio button and then change for it to show the correct SPAN tag.



      Here's the selectOneRadio control:


      <h:selectOneRadio value="#{webencode.requestType}" 
        id="rdoRequestType" styleClass="radio" style="width:195px" layout="pageDirection" >
        <f:selectItem itemValue="program" itemLabel="Series or Program"/>
        <f:selectItem itemValue="special" itemLabel="Special"/>
        <a4j:support ajaxSingle="true" event="onclick" reRender="program" />
      </h:selectOneRadio>



      Here are the SPAN tags:


      <a4j:outputPanel id="program" ajaxRendered="true">
        <s:span rendered="#{'program' == webencode.requestType ? true : false}">.....</s:span>
        <s:span rendered="#{'special' == webencode.requestType ? true : false}">.....</s:span>
      </a4j:outputPanel>



      Am I doing something wrong here? Thanks.