title: Primefaces slider <p:slider>: detect sliding
body: <p>Is it possible to detect the event "while sliding" in a primefaces slider?</p>
  
  <p>I have a poll (every 3 seconds the sliders are updated) to update the sliders' values (as multiple clients can use the slide). </p>
  
  <p>When I am sliding and a periodic ajax call is made (by <code>&lt;p:poll&gt;</code>), the slider returns to its initial position. This behavior is understandable, because the form itself is refreshed.</p>
  
  <p>I need to avoid this: when I'm sliding, I want the poll to stop. When I stop sliding the ajax event "slideEnd" is called. In this event, I would return the poll refresh process normally.</p>
  
  <p>Is this possible? What would I need?</p>
  
  <p>Edit: I found out about onSlide and onSlideStart attributes of <code>&lt;p:slider&gt;</code>. I used something like:</p>
  
  <pre><code>&lt;p:slider for="porta2005" minValue="0.0" maxValue="100.0" step="1" styleClass="width-100" onSlide="#{dimmerBean.slideStart()}"&gt;
      &lt;p:ajax event="slideEnd" listener="#{dimmerBean.mudaTensao2005}" update="tensao2005"/&gt;
  &lt;/p:slider&gt;
  </code></pre>
  
  <p>But the method <code>slideStart()</code> is called on every poll request inside bean, not only when I effectively slide. Is it wrong to call a bean method inside onSlide like this?</p>
  
  <p>I am using Primefaces 6.1.</p>