This content has been marked as final.
Show 4 replies
-
1. Re: Trigger ajax load from javascript
sergeysmirnov Apr 23, 2007 2:09 PM (in response to kindsol)it is very easy. just use a4j:jsFunction
-
2. Re: Trigger ajax load from javascript
kindsol Apr 23, 2007 3:51 PM (in response to kindsol)Thank you for your reply.
The a4j:jsFunction triggers a javascript function after the ajax call has been invoked.
What I am looking for is a way to invoke the ajax call via javascript and have the returned data update the components specified in an a4j: tag's reRender attribute list.
I hope this makes sense.
Is this possible?
Thank you for your time :) -
3. Re: Trigger ajax load from javascript
sergeysmirnov Apr 23, 2007 4:12 PM (in response to kindsol)"kindsol" wrote:
The a4j:jsFunction triggers a javascript function after the ajax call has been invoked.
No, it is invoked BEFORE and used for sending the ajax request as well"kindsol" wrote:
What I am looking for is a way to invoke the ajax call via javascript and have the returned data update the components specified in an a4j: tag's reRender attribute list.
This is what jsFunction is designed for.
jsFunction has a name attribute. This is a name of the javascript function you can use to invoke the ajax request.
jsFunction can have f:param and a4j:actionparam children that are used for for passing parameters of the javascript function to ajax request
jsFunction has a data attribute that is used to return data from the server (in JSON format)
jsFunction has an oncomplete attribute that you can use to invoke any javascript function and pass the data taken from data attribute
Do you need more info? -
4. Re: Trigger ajax load from javascript
kindsol Apr 23, 2007 6:13 PM (in response to kindsol)OK. I got it. This tag renders into a javascript function with the name given by the "name" attribute
I got it working -- thank you for bearing with me :)