This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes JSF and the fly likes JSF with Ajax question (apache myFaces Tomahawk) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF with Ajax question (apache myFaces Tomahawk)" Watch "JSF with Ajax question (apache myFaces Tomahawk)" New topic

JSF with Ajax question (apache myFaces Tomahawk)

Srinivasa John

Joined: Aug 10, 2009
Posts: 1
I am new to JSF, trying to make a ajax call when radio button clicked. I wrote following code it's not working.

I am using apache myFaces (Tomahawk 1.2)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns=""
<h:form id="form">
<hutputText id="out1" value="#{count.count}"/>
<h:selectOneRadio valueChangeListener="#{count.count}" id="count1" value="#{count.count}" immediate="true" onchange="jsf.ajax.request(this, event, {execute: '', render: 'out1'}); return false;">
<f:selectItem itemLabel="goods" itemValue="1" />
<f:selectItem itemLabel="service" itemValue="0" />


import javax.faces.event.ActionEvent;

public class Count {
Integer count = 0;

public Integer getCount() {
return count++;

public void reset(ActionEvent ae) {
count = 0;

if you have steps please post it here.

Shasi Mitra
Ranch Hand

Joined: Nov 27, 2008
Posts: 101

I suggest you to use ajax4jsf which is very easy to plug in.
I agree. Here's the link:
subject: JSF with Ajax question (apache myFaces Tomahawk)