On Wed, Feb 29, 2012 at 2:53 PM, armhold <armh...@gmail.com> wrote: > Hi Martin, > > I'm following the example > https://cwiki.apache.org/WICKET/calling-javascript-function-on-wicket-components-onclick.html > shown here . My code is literally that, added to the prototypical Wicket > Quickstart HomePage.java: > > public class HomePage extends WebPage { > private static final long serialVersionUID = 1L; > > public HomePage(final PageParameters parameters) { > add(new Label("version", > getApplication().getFrameworkSettings().getVersion())); > > AjaxLink ajaxLink = new AjaxLink("ajaxLink") { > > @Override > public void onClick(AjaxRequestTarget target) > { > System.out.println("onClick fired"); > } > > protected IAjaxCallDecorator getAjaxCallDecorator() { > return new AjaxCallDecorator() { > public CharSequence decorateScript(CharSequence script)
Put @Override on the line above and you will see that the compiler complains. Please update the wiki with the new signature for 1.5 > { > return "alert('This is my javascript call'); " + > script; > } > }; > } > }; > > add(ajaxLink); > } > } > > If I inspect the generated HTML, it looks like this: > > # This is an ajax link. > > Thanks for your time. > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/wrapping-onclick-in-AjaxLink-with-1-5-4-tp4430306p4431400.html > Sent from the Users forum mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org