Hi All,
I Need to Hide/Show the outputpanel when i select one option from <h:selectOneRadio> using a4j:support.
By default Date output panel is hidden but when yes option is selected it should be displayed and vice versa using ajax support.
<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="PanelDate" />
</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("3")){
setDisplayDate(true);
}
}
But the problem is entire page is getting refreshed instead of panel.
Please help me in resolving this issue.
Thanks in Advance.
Kriss