Call Javascript function on receiving ajax response in JSF 2.0
ajax, jsf
Solution
`<f:ajax>` has `onevent` and `onerror` attributes. Give them a try.
Alternatively, Richfaces `<a4j:support>` has the `oncomplete` attribute for that purpose.
Problem
I'm using JSF 2.0 and it's new (actually old, but now incorporated in JSF) ajax features. I have something like this: ``` <h:inputText id="name" value="#{coordinatesMBean.name}"/> <h:commandButton value="Reverse me!"> <f:ajax execute="name" render="reverseName"/> </h:commandButton> <h:outputText id="reverseName" value="#{coordinatesMBean.reverseName}"/> ``` It works fine, after hitting button value from inputText is sent to server, put into managed bean, and `reverseName` is rerendered with new data. What I want to do is not only rerendering `reverseName`, but also call some Javascript function when ajax response is received.