tags:

views:

10

answers:

0

Hi All,

Ive a problem in refreshing the outputpanel entire page is getting refersed instead of panel.

Here is my code

<h:selectOneRadio id="radio1Id" value="#{bean.options}" valueChangeListener="#{bean.onChange}">  
<f:selectItem itemLabel="Yes" itemValue="Yes" />  
 <f:selectItem itemLabel="No" itemValue="No" />  
 <a4j:support event="onclick" reRender="quater" />  
 </h:selectOneRadio> 

<a4j:outputPanel id="quater" ajaxRendered="true" rendered="#{bean.displayDate}">
 <h:outputText value="From" styleClass="OuputText"/> 
 </a4j:outputPanel>

private boolean displayDate;
public void onChange(ValueChangeEvent event){   
  HtmlSelectOneRadio radio=(HtmlSelectOneRadio) event.getComponent();  
  System.out.println(radio.getValue());  
  if(!radio.getValue().equals("Yes")){
   setDisplayDate(true);
  }else{
   setDisplayDate(false);
  }
 }

Actually page get refreshed when i select any of the radio button in stead of only outputpanel is there any solution for it or could any one give me the code which does the process .

On selecting radio button 'yes' outputpanel should be displayed and hide if 'no' is selected.

Thanks in advance.