managed bean method will be invoked, according to id of commandButton, right? so business logic will be processed exactlly although generated html source code be like "onclick="return false" ".
but, if no managed bean method binded, such as a Cancel button, the whole page will be reloaded, which should not be.
ym feng wrote:managed bean method will be invoked, according to id of commandButton, right?
That's correct.
so business logic will be processed exactlly although generated html source code be like "onclick="return false" ".
That's not correct. No request would be fired to the server side.
but, if no managed bean method binded, such as a Cancel button, the whole page will be reloaded, which should not be.
then, how to prevent it, if click Cancel button?
Let the onclick return false or use a plain vanilla button, e.g. <input type="button">.
first i want to thanks for your reply.
i found that if no binded action for a commandButton, the page actually refresh after clicking it with no business logic processed. It's just due to JSF mechanism?