You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by burnt99 <be...@hpi.uni-potsdam.de> on 2008/06/20 15:44:48 UTC

Callback URL raises JavaScript syntax error

Hi folks,

I want to use a Yahoo UI API button and to add a Wicket Listener to one of
its event. The Yahoo UI API button has a method for this which mus be called
as
button.addListener("click", functionname);  
I am not a JavaScript expert, so I assume, methodname is something like a
function pointer. So in my Wicket Java file, I add a header contribution
with this and set the CallbackUrl of my Behavior class as functionname.
Unfortunately, the callback URLs start with a "?" and have some other
symbols in their name. This raises a JavaScript error, Firebug says "syntax
error". There is no error, if I put the callback URL in quotation marks, but
then the callback is not triggered. Any hint?
Thanks a lot!
Best regards
-- 
View this message in context: http://www.nabble.com/Callback-URL-raises-JavaScript-syntax-error-tp18029898p18029898.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Callback URL raises JavaScript syntax error

Posted by Igor Vaynberg <ig...@gmail.com>.
you have to give it the name of javascript function which will invoke
the url, not just the url itself.

eg addeventlistener(this, function() { window.location='url'; })
or addeventlistener(this, myfunc); function myfunc() { window.location='url'; }


-igor

On Fri, Jun 20, 2008 at 6:44 AM, burnt99
<be...@hpi.uni-potsdam.de> wrote:
>
> Hi folks,
>
> I want to use a Yahoo UI API button and to add a Wicket Listener to one of
> its event. The Yahoo UI API button has a method for this which mus be called
> as
> button.addListener("click", functionname);
> I am not a JavaScript expert, so I assume, methodname is something like a
> function pointer. So in my Wicket Java file, I add a header contribution
> with this and set the CallbackUrl of my Behavior class as functionname.
> Unfortunately, the callback URLs start with a "?" and have some other
> symbols in their name. This raises a JavaScript error, Firebug says "syntax
> error". There is no error, if I put the callback URL in quotation marks, but
> then the callback is not triggered. Any hint?
> Thanks a lot!
> Best regards
> --
> View this message in context: http://www.nabble.com/Callback-URL-raises-JavaScript-syntax-error-tp18029898p18029898.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org