Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using jquery ajax to call a jsf managed bean method (an AjaxBehaviorEvent listener handler)

i would like to know if there is a way to fire a jsf managed bean method (with an AjaxBehaviorEvent type parameter: the same triggered when using f:ajax) directly by using a jquery ajax server request.By the way , i m a jsf developper and i didn't find an example about using jquery ajax with Java EE as a server-side framework, all examples i found were with php..so i wish to get a complete example about doing that. i think the other workaround maybe is to make a commandLink being submitted with jquery on the client side and passing parameters through that call but i prefer the former solution and i wish it work.

Thanks very much for help !

like image 540
Bardelman Avatar asked Jan 23 '13 09:01

Bardelman


1 Answers

Here you go:

<script type="text/javascript">

    doAwesomeness();

</script>

In your page:

<a4j:jsFunction name="doAwesomeness" action="#{awesomeBean.awesomeMethod}"/>

Good luck!

like image 200
islandguy Avatar answered Sep 24 '22 14:09

islandguy