title: JSF CommandButton action before submit
body: <p>I've created JSF 1.1 page.
  In the page I have 2 textboxes and commandbutton.
  The textboxes are connected to object in the backing bean, and thw object's values are showed there, and the user can edit it as he wants, and when he clicks on the button I want to go to the bean and save the new values in the object.
  The bean must be request, not session!</p>
  
  <pre><code>&lt;h:inputText value="myBean.PersonName"&gt;&lt;\h:inputText&gt;
  &lt;h:commandButton action="myBean.saveEditName"&gt;&lt;\h:inputText&gt;
  </code></pre>
  
  <p>backingBean:</p>
  
  <pre><code>public String saveEditName(){
  //Go to database and save the new object
  }
  </code></pre>
  
  <p>The problem is, when I click on the button, the bean is refreshed, the objects returns to its previous values, and then the action is invoked.
  Why is that? How can I perform an action before the submit refreshes the bean? (Without using servlet in javascript).</p>
  
  <p>Thanks!</p>