ExternalContext external = context.getExternalContext();
Map requestParams = external.getRequestParameterMap();
String clientId = component.getClientId(context);
UIDataFltrSlider dataFilterSlider = (UIDataFltrSlider) component;
Integer oldSliderVal = dataFilterSlider.getHandleValue();
//Here we get new slider val and compare with old value
Integer newSliderVal = dataFilterSlider.getStartRange();
if (requestParams.get(clientId + "slider_val") != null
&& !"".equals(requestParams.get(clientId + "slider_val"))) {
try {
newSliderVal = Integer.valueOf(requestParams.get(clientId + "slider_val").toString());
} catch (NumberFormatException nfe) {
newSliderVal = oldSliderVal;
}
}
if (newSliderVal.equals(oldSliderVal)) {
//you could use this to reset the table, but it gets called when the dataScroller is clicked also
//The only way I know to reset the table is to find the component and use helper to reset in an actionListener
//ajaxSlider.resetDataTable();
//ajaxSlider.setHandleValue(ajaxSlider.getStartRange());
} else {
dataFilterSlider.setHandleValue(newSliderVal);
DataFilterSliderEvent event = new DataFilterSliderEvent(dataFilterSlider, oldSliderVal, newSliderVal);
// dataFilterSlider.queueEvent(event);
event.queue();
if (dataFilterSlider.isStoreResults()) {
dataFilterSlider.filterDataTable(newSliderVal.intValue());
}
}
}