Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem a4j:support for h:selectOneRadio in JSF

843844Jul 11 2010 — edited Jul 14 2010
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

Comments

This is a fabulous project, I have had problems with using java for real time applications because of the garbage collection mechanism.  I have used configuration techniques to minimize garbage collection, I'm wondering if you could address that here?

unknown-3392251

tanx is soo goood

طراحی سایت

Kashif Sohail

Is there any starter kit available for beginners?

Jose Cruz

Is there any starter kit available for beginners?

Dear Kashif

No, there isn't, because it is one of my hobby projects that I share with Java ME community.

If you need I can help you about your needs.

Best Regards

1 - 4
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Aug 11 2010
Added on Jul 11 2010
6 comments
1,950 views