1 Reply Latest reply on Jun 25, 2013 6:09 AM by michpetrov

    keyup event not firing with <a4j:ajax>

    sumitghosh945

      I have used keyup event with <a4j:ajax> in a <h:inputText>,the funtionality is like that,if I edit the Ist <h:inputText>,then the second <h:inputText> will become editable also,otherwise it is not editable.I have done this using render attribute in first <h:inputText>,in that attribute I have passed the id of 2nd <h:inputText>.

       

      Things are working fine when I am pressing backspace or delete button and deleting the characters one by one.But when I'm selecting the entire ext throgh mouse and pressing backspace/delete to delete the entire text at a glance,as we generally do for quick deletion.then the keyup event no firing,I came to know this due to the fact 2nd <h:inputText> not getting editable when I'm selecting the entire text of first <h:inputText> field and then pressing backspace/delete button.

       

       

                            

      <h:inputText id="inp1" required="true" requiredMessage="Choose Proper Party Name."  readonly="#{billController.editPartyName}" autocomplete="off"

                      value="#{billController.currentBill.partyName}" valueChangeListener="#{billController.updateVendorName}"  styleClass="coinsidefield1">

           <a4j:ajax event="keyup" render="vendorPAN" />

      </h:inputText>

       

       

      <h:inputText value="#{billController.currentBill.vendorPAN}" autocomplete="off" id="vendorPAN"  readonly="#{billController.vendorPanDisabled}"

             validator="#{validator.checkPanFormate}" required="#{billController.vendorPanValidation}"

            requiredMessage="PAN No cant be empty"  style="margin-left:93px;width:134px;font-style:bold"/>

        • 1. Re: keyup event not firing with <a4j:ajax>
          michpetrov

          How is the billController.vendorPanDisabled determined?

           

          The keyUp event is being fired, you can test it like this:

          <a4j:ajax event="keyup" oncomplete="alert('keyUp')" />
          

          What is not being fired is the valueChangeListener, I don't think it will let you set an empty value.