title: How to disable/re-enable JSF component using javascript?
body: <p>I'm developing a Java EE application (JSF2 + richfaces 3.3.3 + facelets).</p>
  
  <p>I want to disable my h:selectOneMenu when loading my page, and when it finishes loading (using the function onload()), I want to re-enable my component.
  I have something like this:</p>
  
  <pre><code>&lt;ui:define name="infosHead"&gt;
       &lt;script type="text/javascript"&gt;
          window.onload = function() {
            document.getElementById("forme1_myform:valueCh").disabled = false;
            alert("here");
          }
       &lt;/script&gt;
  &lt;/ui:define&gt;
  &lt;ui:define name="infosBody"&gt;
     &lt;h:form id="forme1_myform" target="_blank"&gt;
      &lt;h:selectOneMenu id="valueCh" value="#{mybean.value}" disabled="true" &gt;
        &lt;f:selectItems value="#{mybean.values}" /&gt;
           &lt;a4j:support event="onchange"
                ajaxSingle="true"
                limitToList="true"                      
                reRender="id1,id2,...."
                ignoreDupResponses="true"
                action="#{mybean.actionme}"
                oncomplete="getId();"/&gt;
           &lt;/h:selectOneMenu&gt;
     &lt;/h:form&gt;
  &lt;/ui:define&gt;
  </code></pre>
  
  <p>this is working fine.
  But my bean is getting nothing (mybean.value == null).</p>
  
  <p>It's like he thinks that the component is still disabled.</p>
  
  <p>how can I make this works ?</p>