title: Value not set correctly with JavaScript and Primefaces
body: <p>im sending a variable with a JS to an inputtext. then when the value has been set i click on a p:commandButton to call a method that uses that value but the value that passes is blank... although the js sent the value to the input and i see it... it takes it as blank. if i input the value myself it does read it in the method... otherwhise it does not... any ideas?
  here's my code as much resumed as i can get it (it's kind of long):</p>
  
  <p>XHTML:</p>
  
  <pre><code>&lt;!-- Modal --&gt;
              &lt;div class="modal fade" id="myModalId" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt;
                &lt;div class="modal-dialog"&gt;
                  &lt;div class="modal-content"&gt;
                    &lt;div class="modal-header bg-warning"&gt;
                      &lt;button type="button" class="close" data-dismiss="modal"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;span class="sr-only"&gt;Close&lt;/span&gt;&lt;/button&gt;
                      &lt;h4 class="modal-title" id="myModalLabel"&gt;&lt;b&gt;#{msg.html32}&lt;/b&gt;&lt;/h4&gt;
                    &lt;/div&gt;
                    &lt;div class="modal-body"&gt;
                     &lt;center style="font-size: 14px"&gt;#{msg.html31}&lt;/center&gt;
                    &lt;/div&gt;
                    &lt;div class="modal-footer"&gt;
                      &lt;p:commandLink  action="#{bd.setId(dotcalpro.id)}"  styleClass="btn btn-md btn-info" value="#{msg.htmlborrar}" immediate="true" update="tbResult, growl" accesskey="r" onclick="modalIdhide()"/&gt;
                      &lt;p:spacer height="5"/&gt;
                      &lt;p:commandLink  styleClass="btn btn-md btn-info" value="#{msg.html48}" immediate="true" update="tbResult, growl" onclick="modalIdhide()"/&gt;
                     &lt;/div&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;  
  
          &lt;p:column width="60"&gt;  
          &lt;f:facet name="header"&gt;#{msg.dotcalprotbver}&lt;/f:facet&gt; 
          &lt;center&gt;
          &lt;button type="button" class="btn btn-warning btn-xs"
          onclick="detalle('#{tb.zid}'); modalIdshow();" &gt;
          &lt;i class="fa fa-search fa-2x"&gt;&lt;/i&gt;
          &lt;/button&gt;
          &lt;/center&gt;
          &lt;/p:column&gt;  
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>function detalle(vT0){
      document.getElementById("formdotcalpro:id").value= rTrim(vT0);
      updateInput('formdotcalpro:id', '#F2F2F2')
      //alert(document.getElementById("formdotcalpro:id").value);
      var x = document.getElementById("formdotcalpro:id").value;
      alert("valor: " + x)
  }
  
  //Modal id show
  function modalIdshow(){
      $("#myModalId").modal();
  }
  
  
  //Modal id hide
  function modalIdhide(){
      $("#myModalId").modal('hide');
  }
  </code></pre>
  
  <p>Bean:</p>
  
  <pre><code>/**
   * Setea tipo de valor de la meta para busqueda
   * @param next
   */
  public void setId(String id){
      FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put("id", id);
      System.out.println("valor : " + id);
  }
  </code></pre>
  
  <p>I say again just in case i have resumed the code as much as posible.</p>