5 Replies Latest reply on Sep 16, 2008 5:28 PM by tszpinda

    disable command button during ajax

    tszpinda

      Hi, I must disable submit button while using converter with ajax.


      Can anyone please tell me why this doesn't work, why button isn't disabled after onblur event occur:



      <h:inputText id="qtyBox"       
          value="#{cart.stockQuantity}" 
          required="true">
          <f:converter converterId="quantityConverter"/>
          <f:validator validatorId="quantityValidator"/>
          <a4j:support event="onblur" 
           ajaxSingle="true" 
           reRender="qtyBox" 
           bypassUpdates="false" 
           eventsQueue="validation"
              onsubmit="document.getElementById('mainForm:addButtonId').disable=true;"     
           />
        </h:inputText>
      
        <h:commandButton id="addButtonId"
           action="#{cart.addLine(stockHome.instance)}" 
           value="#{messages['stock.page.button.add']}"
           onclick="Richfaces.showModalPanel('mainForm:orderProgressId');">                         
         </h:commandButton>




      Thanks in advance,
      Tomek