Call the server from a javascript function

View: New views
4 Messages — Rating Filter:   Alert me  

Call the server from a javascript function

by asfernandes :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I need to call the server side from a javascript (generated by a
component) function. Kind of Link/AjaxLink onClick, but instead of have
it attached to a DOM event, I need to generate the javascript function
that does the job.

Could you point me out how I could do it?


Adriano


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


Re: Call the server from a javascript function

by Timo Rantalaiho :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, 07 Oct 2008, Adriano dos Santos Fernandes wrote:
> I need to call the server side from a javascript (generated by a
> component) function. Kind of Link/AjaxLink onClick, but instead of have
> it attached to a DOM event, I need to generate the javascript function
> that does the job.

E.g.

  myComponent.add(new AjaxEventBehavior("onblur") {
      @Override
      public void onEvent(AjaxRequestTarget target) {
          doStuff();
      }
  });

Read up on Wicket ajax, and check out the ajax examples in
wicket-examples.

Best wishes,
Timo

--
Timo Rantalaiho          
Reaktor Innovations Oy    <URL: http://www.ri.fi/ >

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


Re: Call the server from a javascript function

by jWeekend :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Adriano,

Create the AbstractAjaxBehaiour you want, call getCallbackUrk() on it and use the returned URL as a parameter to wicketAjaxGet in the JavaScript you're generating.

Regards - Cemal
http://jWeekend.co.uk


asfernandes wrote:
I need to call the server side from a javascript (generated by a
component) function. Kind of Link/AjaxLink onClick, but instead of have
it attached to a DOM event, I need to generate the javascript function
that does the job.

Could you point me out how I could do it?


Adriano


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

Re: Call the server from a javascript function

by asfernandes :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

jWeekend escreveu:
> Adriano,
>
> Create the AbstractAjaxBehaiour you want, call getCallbackUrk() on it and
> use the returned URL as a parameter to wicketAjaxGet in the JavaScript
> you're generating.
Thanks, Cemal. I'm now able to go further.


Adriano


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

LightInTheBox - Buy quality products at wholesale price!