title: JSF (and PrimeFaces) How to pass parameter to a method in ManagedBean
body: <p>I have an Employee object I am showing in inputtext.
  For example, the firstname of the employee is shown in an inputtext. When the value of this firstname changes it calls a method. Before this is done I want to call a method which saves the ID of the employee in the managedbean so I know which employee needs to be changed.
  How do I do this, I got this so far:</p>
  
  <pre><code>&lt;h:outputText value="First name:"/&gt;
  &lt;p:inplace id="firstname" editor="true"&gt;
       &lt;p:ajax event="save" onsuccess="#{employeeController.saveName()}"/&gt;
       &lt;p:inputText id="firstName" value="#{emp.firstName}"  
                    required="true" label="text"
                    valueChangeListener="#{employeeController.firstNameChanged}"&gt;
       &lt;p:ajax event="valueChange" listener="#{employeeController.onValueChangedStart}"/&gt;
       &lt;/p:inputText&gt;
  &lt;/p:inplace&gt;
  </code></pre>
  
  <p>I guess I should pass the ID with the onValueChangedStart or firstNameChanged method. How do I do this? Or is there a better way to do this? There is a getter for the emp. So #{emp}.id to get it.</p>