title: Calling a managed bean method when some button is clicked
body: <p>I am new to JSF and want to have a button, which when clicked, will call a method of the backing bean. Is this possible or I have to use AJAX or something? I tried things like</p>
  
  <pre><code>&lt;button onclick="#{myManagedBean.myMethod()}"&gt;MyButton&lt;/button&gt;
  </code></pre>
  
  <p>But they didn't work. What's the normal way of doing it?  </p>
  
  <p>Edit:<br>
  That button is created by JqueryUI, and I am unable to change the button's type to commandButton. I am able to do only two customizations-<br>
  1. call javascript functions from that button<br>
  2. change the target of the form (inside which the button resides)<br>
  So, how can I call the backing bean method from these two ways, like from Javascript or on form submit?</p>