I have a simple jsf form with a button that is supposed to trigger a method call on the backing bean
<h:form id="form">
<h:commandButton id="button" value="Submit" action="#{controller.submit}"
onComplete="promptSuccess('Changes submitted successfully')" />
</h:form>
Everytime I press that button, the page refreshes and the JavaScript function 'promptSuccess' never even gets called.
I would like the form to be updated and also the success function be called as soon as the changes have been submitted. But the whole page gets refreshed.
I did see a few examples on SO but none of them proved useful to my particular problem/situation.
I would really appreciate some help on this.
Examples referred to: