1 Reply Latest reply on Jan 29, 2009 7:45 PM by Nick Belaevski

    Problem with InputNumberSlider ValueChangeListener

    Ronan Forker Newbie

      I might not have understood the correct function of the InputNumberSlider's ValueChangeListener however I cannot get the slider to poll the sever with the new value 'on slide'. Only when I press enter on the input field.

      jsf:

      <f:view>
       <h:form>
       <rich:inputNumberSlider value="#{RedactionManagedBean.selectedPage}"
       minValue="1"
       maxValue="20"
       valueChangeListener="#{RedactionManagedBean.listener}"
       enableManualInput="false"
       width="400px"
       id="pageSlider">
       </rich:inputNumberSlider>
       </h:form>
      </f:view>
      


      bean:

       public void listener(ValueChangeEvent event) {
       System.out.println(event.getSource());
       }
      


      I have tried in both session and request scope. Although again, I may have missinterpreted the function of the slider?

      Thanks,

        • 1. Re: Problem with InputNumberSlider ValueChangeListener
          Nick Belaevski Master

          Hello,

          valueChangeListener is server-side event. It is generated after browser request is processed by the server (of course, for the case of changed value). rich:inputNumberSlider is a pure client-side component; like any input it doesn't cause interaction with the server itself.

          You can add a4j:support so that it will send AJAX requests to the server in response to some browser-side user activity or you can use a4j:commandButton. Everything depends on the application logic.