4 Replies Latest reply on Apr 26, 2011 2:17 AM by beanfarmer

    rich:pickList 3.3.1: how to disable at "client side"?

    beanfarmer

      I know everybody trying richfaces 4.0. Please try to answer this. Thank you.

       

      Client side: need help. I have tried following but no success.

       

       <script type="text/javascript">
      
              function disablePickList(){
                     ${rich:component('componentID')}.disable();  -- not working
                     ${rich:element('componentID')}.setAttribute('class', 'rich-list-picklist rich-list-picklist-disabled'); --not working
             }
      </script>
      

       

      Server Side Setting: <rich:pickList disabled = "true"/> works.

        • 1. rich:pickList 3.3.1: how to disable at "client side"?
          motterobo

          Hi Srini,

           

          Can you let me know on which event you want to disable the componnet?

           

          Regards,

          MotteRobo

          • 2. rich:pickList 3.3.1: how to disable at "client side"?
            beanfarmer

            Hi motte,

             

            Here we go....

            Why I want to disable pickList at clientSide:

            onkeyup I have to fire an ajax request during that time, I want to disable the pickList so that it will be enabled when reRender called.

            <h:inputText id="documentNumber" onkeydown="disablePickList();"   value="#{docFilterManager.documentNumber}">

                   <a4j:support requestDelay="1000" event="onkeyup" action="#{docFilterManager.handleDocNumChange()}"  eventsQueue="mainQueue"                           reRender="componentID"/>

            </h:inputText>

            • 3. rich:pickList 3.3.1: how to disable at "client side"?
              motterobo

              hi Srini,

               

              in a4j:support we have an event called oncomplete="disablePickList()".

              this will be called once the request is completed on client side.

               

              Regards

              Motte

              • 4. rich:pickList 3.3.1: how to disable at "client side"?
                beanfarmer

                Hi motte,

                 

                Thanks for your response. but you got me wrong.

                 

                first of all I want to disable the pickList when I a raise Ajax request on keyup or before using keydown event at client side.

                secondly I neither have problem in calling the javscript method or with the event.

                 

                I have problem in disabling the pickList at client side. Please refer to my original post.

                Please let me know if you have any idea on this. 

                 

                Regards

                Srini