0

I'm a noob learning Wicket/Jquery. I'm trying to access JavaScript (Jquery) variables from Wicket. Here's an example I'm working with:

        Component slider = new WebMarkupContainer("slider").add(new SliderBehavior(
            new SliderOptions().changeEvent("alert('clicked!')").orientation(Orientation.HORIZONTAL).min(10).max(100).value(20)));

I'm implementing here a jqwicket slider example. Instead of the "alert('clicked!')" event I would like to read the value of the slider to the java. All help appreciated!!!

1
  • There is no thing such as a "jquery variable". jQuery is awesome but it's just a JavaScript library. So there are only JavaScript variables. Commented Feb 28, 2011 at 9:07

2 Answers 2

1

you have to combine jquery's "changeEvent" with the ajax request sending current slider value to your wicket component.

jqwicket contains example for doing this. for more information see AjaxSlider here:

http://code.google.com/p/jqwicket/source/browse/tags/jqwicket-demo-0.4/jqwicket-demo/src/main/java/net/javaforge/jqwicket/SliderPage.java

Sign up to request clarification or add additional context in comments.

Comments

1

https://github.com/wicketstuff/core/blob/master/jdk-1.5-parent/jquery-parent/jquery-examples/src/main/java/org/wicketstuff/jquery/demo/ui/Page4Slider.java

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.