You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by freak182 <em...@gmail.com> on 2008/10/21 09:21:41 UTC

How to get return value from javascript

Hello,

My problem is how can i get the return value of a javascript function: e.g

init.js

funtion userExist(id)
{
....................
return true;
}

how can i get the returned value "true" from wicket.

Thanks a lot...Cheers

-- 
View this message in context: http://www.nabble.com/How-to-get-return-value-from-javascript-tp20084787p20084787.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: How to get return value from javascript

Posted by Jaap Bos <Ja...@topicus.nl>.
You could use a wicket HiddenField and let your js function write his result to this field. At the next (ajax) request you are able to read the value from this field.

Jaap

-----Original Message-----
From: Piller Sébastien [mailto:pills@hmcrecord.ch] 
Sent: dinsdag 21 oktober 2008 9:49
To: users@wicket.apache.org
Subject: Re: How to get return value from javascript

js is client side, and wicket is server side.

to pass a value from js to wicket, you may do an ajax query. see 
wicketAjaxGet and AbstractDefaultAjaxBehavior

freak182 a écrit :
> Hello,
>
> My problem is how can i get the return value of a javascript function: e.g
>
> init.js
>
> funtion userExist(id)
> {
> ....................
> return true;
> }
>
> how can i get the returned value "true" from wicket.
>
> Thanks a lot...Cheers
>
>   


---------------------------------------------------------------------
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


Re: How to get return value from javascript

Posted by Piller Sébastien <pi...@hmcrecord.ch>.
js is client side, and wicket is server side.

to pass a value from js to wicket, you may do an ajax query. see 
wicketAjaxGet and AbstractDefaultAjaxBehavior

freak182 a écrit :
> Hello,
>
> My problem is how can i get the return value of a javascript function: e.g
>
> init.js
>
> funtion userExist(id)
> {
> ....................
> return true;
> }
>
> how can i get the returned value "true" from wicket.
>
> Thanks a lot...Cheers
>
>   


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