0 Replies Latest reply: Apr 10, 2012 4:37 PM by nt2005 RSS

    rich:inputNumberSlider disable via Javascript

    nt2005 Newbie

      Hey Guys,

       

      I want to disable a rich:inputNumberSlider via checkbox -> Javascript.

       

      For an input I use something like that and it works great:

      <h:inputText id="input" value="#{foo.input}" />
      <h:selectBooleanCheckbox
          value="#{foo.checkbox}"
          onchange="document.getElementById(#{rich:clientId('input')}).disabled=true" />
      

       

      But for rich:inputNumberSlider I need something more, because it does not work.

      First I disable the input on the right of a slider: Works!

      <rich:inputNumberSlider id="inputNumberSlider" value="#{foo.result}"/>
      <h:selectBooleanCheckbox
          value="#{foo.checkbox}"
          onchange="document.getElementById('#{rich:clientId('inputNumberSlider')}Input').disabled=true;" />
      
      

      But I also need to disable the slider itself. But there is a function from richfaces, I cannot edit or?

      <script type="text/javascript">
           new Richfaces.Slider("j_id35:1:j_id44:j_id45:1:inputNumberSlider",{'sliderValue':'0','disabled':false} ) 
      
      </script>
      

       

       

      I don´t want to use ajax and rerender because of minimum dataflow.