You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Christoph GrĂ¼n <ch...@gmx.at> on 2009/05/07 10:21:20 UTC

jquery slider component not working

Hello,

 

I tried out different slider components jquery slider
(jquery-examples-1.4-20090427.160726-150.war), yui slider
(yui-examples-1.4-20090427.160726-141.war).

Actually, none of them works out of the box with Wicket 1.4.

 

The class below is the JQuery slider. The onChange method is never called,
so I cannot get the int value of the slider.

 Can anyone give me a hint?

 

public class Page4Slider extends WebPage {

 

    public Page4Slider() {

        

        final SliderHandleOptions sliderOneHandleSettings = new
SliderHandleOptions(

                "uno", 0);

 

        final SliderOptions sliderOptions = new SliderOptions();

        sliderOptions.setStepping(10);

        sliderOptions.setMin(0);

        sliderOptions.setMax(100);

        sliderOptions.setRange(false);

 

        // sliderOptions.setOnChange("console.log('ui: ' + ui.toSource());",
"e", "ui");

 

        @SuppressWarnings("serial")

        final Slider slider = new Slider("slider", sliderOptions,
sliderOneHandleSettings) {

            @Override

            public void onChange(AjaxRequestTarget target, String handleId,
int value) {

                info(String.format("Handle with id '%s' changed its value to
'%d'",

                        handleId, value));

                target.addChildren(getPage(), FeedbackPanel.class);

            }

 

        };

        add(new FeedbackPanel("feedback").setOutputMarkupId(true));

        add(slider).setOutputMarkupId(true);

    }

}

 

Thanks a lot,

Christoph