Wednesday, 18 September 2013

Preventing JSF commandButton from reloading the page

Preventing JSF commandButton from reloading the page

I have a page with 2 forms on it.
Initially, one of them is hidden while the other is visible. When the
first one is filled in and the submit/continue button is clicked, the
first one should be hidden and the second one should be display.
When I click the button, it hides the first form and displays the second,
but after a moment the page reloads and I'm staring at the first form
again. Does anyone know what I can do to prevent this from happening?
Here is the button I use:
<h:commandButton immediate="true" value="Continue" styleClass="btn
btn-warning btn-large btn-block" onclick="formClick('adult',
#{adult.index})"></h:commandButton>

No comments:

Post a Comment