I want to get an return value from the a4j:jsFunction. But I don't know how to get this done.
Here's the JSF code:
<h:form>
<a4j:jsFunction name="createEvent" data="#{calendarController.eventId}" action="#{calendarController.createEvent()}">
<a4j:param name="eventTitle"
assignTo="#{calendarController.eventTitle}" />
</a4j:jsFunction>
</h:form>
And I call the a4j:jsFunction like this:
var id = createEvent(event.title);
The Beans method calendarController.createEvent() returns an integer value. The property eventId holds this value to. How can I pass this value back to the javascript code on the page?