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!

Call Java Method on Commanlink action without page refresh

843844Mar 19 2008 — edited Mar 22 2008
Hi,

I have a radio button in my application which on click calls a new JSP page inside DIV tag of the same JSP. Now before calling that JSP Page i want to perform some functionality . So i placed a commandlink on radio like this -
 
<h:commandLink action="#{controller.deleteData}"> 
     <h:selectOneRadio id="licenseType" layout="lineDirection" value="#{controller.licenseType}" onclick="javascript:getServerInfo();"> 
             <f:selectItem itemValue="#{dataTableItem}"/> 
     </h:selectOneRadio> 
</h:commandLink> 
What I am looking for is that when a user clicks on Radio, first a Java method named deleteData() is called and then onclick() event of Radio is processed which loads a new JSP Page inside DIV tag beneath the radio button.

But what happens is that as i click on Radio, command link takes precedence and refreshes the page.

Is it possible for commanlink to just call the method and don't refresh or reload the page ????
Plz assist with some code example
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 19 2008
Added on Mar 19 2008
6 comments
323 views