1 Reply Latest reply on Sep 21, 2010 9:17 PM by sivaprasad9394

    Maximum data entry in rich:comboBox

    lenyas66

      Could somebody advise how to limit the entry in rich:comboBox to only 15 (or any number of) characters?

       

      Thanks,

       

      Leonid

        • 1. Re: Maximum data entry in rich:comboBox
          sivaprasad9394

          In your case it should accept only 15 chars means this should be there first enableManualInput="true"

          next

          Add this code before your f:selectItems

          <a4j:support event="onkeyup"

          actionListener="#{urBeanName.comboValidation}"

          reRender="urComboboxID" limitToList="true" />

           

          public void comboValidation(ActionEvent event) {

           

            if(this.getvalueofcombobox().toString().length()>15)

            {  

          this.setgetvalueofcombobox(this.getgetvalueofcombobox().toString().substring(0, 15)); 

            } 

          }

           

          With out reRender="urComboboxID" you cant display only 15 chars in screen because your enableManualInput="true".

          <a4j:support event="onkeyup"
          actionListener="#{existingCustomerBean.userOfficePhoneNumberValidation}"
          reRender="cbxServiceTypeField" limitToList="true" />