Note that there are some explanatory texts on larger screens.

plurals
  1. POImplementing javascript events to Wicket
    primarykey
    data
    text
    <p>I'm new to ria-development and working with the <a href="http://code.google.com/p/jqwicket/source/browse/tags/jqwicket-demo-0.4/jqwicket-demo/src/main/java/net/javaforge/jqwicket/SliderPage.java" rel="nofollow">Ajax Slider example</a>. I can't figure out how to work with javascript events. Here in the example the onValueChanged-event is preimplemented. How do I implement say onchange- or onSlider-event?</p> <p>All help greatly appreciated!</p> <pre><code>public abstract class AjaxSlider extends WebMarkupContainer { private static final long serialVersionUID = 1L; public AjaxSlider(String id) { super(id); super.setOutputMarkupId(true); } public JQUIComponentBehaivor&lt;SliderOptions&gt; getSlideBehaviors() { List behaviors = getBehaviors(); for(Object behavior : behaviors){ if(behavior instanceof SliderBehavior) return (SliderBehavior) behavior; } return null; } public abstract void onValueChanged(AjaxRequestTarget target, int newValue); @Override protected void onInitialize() { super.onInitialize(); AbstractDefaultAjaxBehavior ajaxBehavior = new AbstractDefaultAjaxBehavior() { private static final long serialVersionUID = 1L; @Override protected void respond(AjaxRequestTarget target) { String sliderValue = RequestCycle.get().getRequest() .getParameter("sv"); if (Utils.isNotBlank(sliderValue)) { onValueChanged(target, Integer.valueOf(sliderValue)); } } }; super.add(ajaxBehavior); super.add(new SliderBehavior(new SliderOptions() .changeEvent(wicketAjaxGet( ajaxBehavior, new MapBuilder&lt;String, Object&gt;().add("sv", js("ui.value")).build())))); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload