You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Martijn Dashorst <ma...@gmail.com> on 2007/09/29 17:50:19 UTC

Future of Link#getOnClickScript

With the advent of behaviors, is Link's getOnClickScript method still
necessary or a relic of the past that should be deprecated and removed
in a future version?

Martijn

-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-beta3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/

Re: Future of Link#getOnClickScript

Posted by Eelco Hillenius <ee...@gmail.com>.
On 9/29/07, Martijn Dashorst <ma...@gmail.com> wrote:
> With the advent of behaviors, is Link's getOnClickScript method still
> necessary or a relic of the past that should be deprecated and removed
> in a future version?

I guess we could remove that.

Eelco

Re: Future of Link#getOnClickScript

Posted by Martijn Dashorst <ma...@gmail.com>.
You could easily use a WebMarkupContainer for that overriding the
oncomponenttag, or  with a SimpleAttributeModifier to add the
javascript.

Martijn

On 9/29/07, David Bernard <dw...@free.fr> wrote:
> FYI, currently I use it to call pure (no server side) javascript function (like hide/show, diseable/enable drag'n drop,...).
> ex :
> add(new Link("stop_dnd") {
>              @Override
>              protected CharSequence getOnClickScript(CharSequence url) {
>                  return dnd.getJSFunctionName4Stop() + "();";
>              }
>
>              @Override
>              protected CharSequence getURL() {
>                  return "#";
>              }
>
>              @Override
>              public void onClick() {
>                  throw new UnsupportedOperationException("NOT CALLABLE");
>              }
>
>          });
>
> The name of the function to call is generated by the server when the page is rendered.
>
> /david
>
> Martijn Dashorst wrote:
> > With the advent of behaviors, is Link's getOnClickScript method still
> > necessary or a relic of the past that should be deprecated and removed
> > in a future version?
> >
> > Martijn
> >
>


-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-beta3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/

Re: Future of Link#getOnClickScript

Posted by David Bernard <dw...@free.fr>.
FYI, currently I use it to call pure (no server side) javascript function (like hide/show, diseable/enable drag'n drop,...).
ex :
add(new Link("stop_dnd") {
             @Override
             protected CharSequence getOnClickScript(CharSequence url) {
                 return dnd.getJSFunctionName4Stop() + "();";
             }

             @Override
             protected CharSequence getURL() {
                 return "#";
             }

             @Override
             public void onClick() {
                 throw new UnsupportedOperationException("NOT CALLABLE");
             }

         });

The name of the function to call is generated by the server when the page is rendered.

/david

Martijn Dashorst wrote:
> With the advent of behaviors, is Link's getOnClickScript method still
> necessary or a relic of the past that should be deprecated and removed
> in a future version?
> 
> Martijn
>