wicket-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Igor Vaynberg <igor.vaynb...@gmail.com>
Subject Re: Unobtrusive JavaScript
Date Wed, 23 Sep 2009 22:07:57 GMT
this is something planned for 1.5 or 1.6

-igor

On Wed, Sep 23, 2009 at 2:36 PM, Matthias Hryniszak
<matthias@hryniszak.de> wrote:
> Hi there,
>
> I was wondering if it'd be possible to generate the JavaScript for i.e.
> AjaxLink components in such a way that the actual JS is not directly there
> as onclick parameter. It's the idea of unobtrusive JavaScript makes the
> markup a lot cleaner and easier to read.
>
> A good example of such an unobtrusive JavaScript approach could be observed
> in jQuery (http://docs.jquery.com/Events/click):
>
> jQuery([item_selector]).click([handler]);
>
> This binds the onclick event of an element to the given handler without
> polluting the actual markup with stuff like
>
> onclick="var
> wcall=wicketAjaxGet('?wicket:interface=:0:link_inc::IBehaviorListener:0:',null,null,
> function() {return Wicket.$('link__inc1') != null;}.bind(this));return
> !wcall;"
>
> which in turn makes reading the generated markup (a bit) harder if there are
> lots of those on the page.
>
>
> Best regards,
> Matthias.
>

Mime
View raw message