title: JSF 2 : How to refresh value into the backing bean from a SelectOneMenu?
body: <p>I use Pretty Faces and JSF 2.</p>
  
  <p>I have a selectOneMenu to choose a value.
  I want then to pass the selected value to a second form with a command button to pass then to an another page. I don't want to see the parameter in the URL. </p>
  
  <p>I don't want the url as this : addpartipant.xhtml, or addparticipant.xhtml?study_name=TEST or /Addparticpant/New/TEST.</p>
  
  <p>I want the URL like this only /Addparticipant/New but if I do this , I don't get to retrieve the good parameter value, I'm only retrieving the value set by default in the bean for the parameter, not the page refreshed value.</p>
  
  <p>More disturbing, I have a button who appears when i change the default value in the page.And it works but it looks like the bean value of parameter is not impact and still stay at default.</p>
  
  <p>How should I to that? Thank for help. I tried so listener in ajax call to set the value param in bean but it's actually not working?</p>
  
  <blockquote>
    <p>/* Form which throws an ajax event when you change the value of the
    selectOneMenu to add the value as a parameter to a second form */</p>
  </blockquote>
  
  <pre class="lang-html prettyprint-override"><code>&lt;h:form id="studySelection_form"&gt;
    &lt;h:outputText value="Sélection de l'étude :"/&gt;
    &lt;h:selectOneMenu  id="study" 
                      value="#{home.study_name}" 
                      required="true"
                      requiredMesage="Selectionnez au moins une étude."&gt;
      &lt;f:selectItems value="#{home.studyNameItems}" 
                     var="c" 
                     itemLabel="#{c.studyNameLabel}" 
                     itemValue="#{c.studyNameValue}" /&gt;
  
      &lt;f:ajax execute="study" 
              render=":add_form" 
              event="change" 
              listener="#{home.updateStudyname}"/&gt;
     &lt;/h:selectOneMenu&gt;
   &lt;/h:form&gt;
  </code></pre>
  
  <blockquote>
    <p>/* Second form where the parameter to pass is injected from an ajax
    call from a move event from the form below */</p>
  </blockquote>
  
  <pre class="lang-html prettyprint-override"><code> &lt;h:commandButton value="Ajout" 
                    type="button" 
                    action="pretty:participant" 
                    rendered="#{home.study_name ne '-----'}" &gt;
     &lt;f:param name="theNameofTheStudy" 
              value="#{home.study_name}"  /&gt;
   &lt;/h:commandButton&gt;
  </code></pre>
  
  <p><em><strong>PrettyFaces Config File :</em></strong> </p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;url-mapping id="participant"&gt;
    &lt;pattern value="/Participant/New/" /&gt;
    &lt;view-id value="/addParticipant.xhtml" /&gt;
  &lt;/url-mapping&gt;
  </code></pre>
  
  <p><em><strong>Page Result addParticipant.xhtml:</em></strong> </p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;h:outputFormat value="Print : {0}, {1} "&gt;
    &lt;f:param value="#{home.study_name}" /&gt;
    &lt;f:param value=" #{theNameofTheStudy}" /&gt;
  &lt;/h:outputFormat&gt;
  </code></pre>