tags:

views:

29

answers:

2

I am writing a JSF 1.2 Application in Apache My faces. I cannot use any customized component library - like tomahawk or a4j and others. Is there a way to call an action method of JSF using Ajax? When the JSF action is done , I would like to handle the response of the JSF action by Javascript and populate a DIV Tag in the Client side ? Is it possible? Thanks.

A: 

Go for Rich Faces. JSFunction.
Doc

org.life.java
Thanks!.RichFaces is a component lib - isn't it ? I cannot use any component library! any other way which will work in JSF 1.2 and plain javascript?
gurupriyan.e
http://stackoverflow.com/questions/1476639/call-jsf-action-thru-jquery-ajax this might help
org.life.java
A: 

JSF 1.2 does not provide any builtin ajax facilities. You have basically 2 options:

  1. Homegrow an ajaxical component library. It isn't that easy since you've to take the JSF lifecycle and component tree into account while handling ajaxical requests. It would also end up to take much more time than using an existing ajaxical component library.

  2. Use an existing ajaxical component library. The simplest one would be Ajax4jsf (pure ajax tags, no UI components, it's much like <f:ajax> in JSF 2.0). This is part of RichFaces, but you can also download and install it separately without the need for the whole RichFaces component library around it. This would be my recommendation. You can find the developer documentation here and download the library here.

BalusC
I am using a servlet (HttpServlet) for now to process Ajax Requests and send the response back. Accepting this as an answer, coz this seems to be the pure JSF way.
gurupriyan.e