*
* @param id
*/
public SliderPanel(String id) {
super(id);
AjaxSlider slider = new AjaxSlider("slider", 1, 30);
slider.setAnimate(true);
slider.setStep(1);
slider.setValue(x);
slider.setAjaxStopEvent(new AjaxSlider.ISliderAjaxEvent() {
private static final long serialVersionUID = 1L;
@Override
public void onEvent(AjaxRequestTarget target, AjaxSlider slider,
int value, int[] values) {
SliderPanel.this.x = value;
target.add(SliderPanel.this.coordinates);
}
});
add(slider);
AjaxSlider slider1 = new AjaxSlider("slider1", 1, 30);
slider1.setAnimate(true);
slider1.setStep(1);
slider1.setValue(y);
slider1.setAjaxStopEvent(new AjaxSlider.ISliderAjaxEvent() {
private static final long serialVersionUID = 1L;
@Override
public void onEvent(AjaxRequestTarget target, AjaxSlider slider,
int value, int[] values) {
SliderPanel.this.y = value;
target.add(SliderPanel.this.coordinates);
}
});
slider1.setOrientation(Orientation.VERTICAL);
add(slider1);
coordinates = new Label("coordinates",
new AbstractReadOnlyModel<String>() {
private static final long serialVersionUID = 1L;
@Override
public String getObject() {
return x + "," + y;
}
});
coordinates.setOutputMarkupId(true);
add(coordinates);
AjaxSlider multiSlider = new AjaxSlider("multiSlider", 1, 100);
ArrayItemOptions<IntegerItemOptions> values = new ArrayItemOptions<IntegerItemOptions>();
values.add(new IntegerItemOptions(1));
values.add(new IntegerItemOptions(30));
values.add(new IntegerItemOptions(80));
multiSlider.setValues(values);
multiSlider.setAjaxStopEvent(new AjaxSlider.ISliderAjaxEvent() {
private static final long serialVersionUID = 1L;
@Override
public void onEvent(AjaxRequestTarget target, AjaxSlider slider,