Hi Ernesto,

thanks for the hint to JSON. 
I am using the jQuery Ajax call and deliver a JSON object as you suggested!

like this:

Works perfectly, just have to put my data into the JSON object and I am
done.

But one small thing, because I am using the jquery ajax call instead of the
wicket one, my Wicket-ajax-indicator does not show during the request. Is
there a quick sollution to make it reappear?

thanks a lot
Reinhard



Ernesto Reinaldo Barreiro-4 wrote
> Hi,
> 
> 1- You want to pass back JSON?
> 
> 1.1- Instead of using wicketAjaxGet use jquery AJAX with same URL to
> behavior. and on behavior respond you do
> 
> RequestCycle.get().scheduleRequestHandlerAfterCurrent(new
> TextRequestHandler("application/json", "UTF-8/Or your encocing", "Ypur
> JSON"));
> 
> This will return some JSON to client.
> 
> 2- You cant to call a function at client side
> 
> target.appendJavaScript("myJavaScriptFunction(the values you want to
> pass)");
> 
> 
> 
> 
> On Wed, Mar 20, 2013 at 2:21 AM, Reinhard <

> reinhard.vornholt@

> >wrote:
> 
>> Hi all,
>>
>> I am not very familliar with the ajax wicket stuff, so I am asking for
>> some
>> advice:
>>
>> I try to build a draggable map for a webbrowser game. From time to time
>> some
>> parts of the map need to be loaded. I like to do this with an ajax
>> request.
>>
>> For the loading I have a AbstractDefaultAjaxBehavior that I added to the
>> page as you can see here:
>>
>>
>>
>> From the javascript part the readMapChunk(x,y) function is caled and from
>> there the ajax call gets to the respond(..) .
>> So far so good, right now I have no clue how to pass a value back to the
>> calling javascript.
>> Whats the right way to do it? I'd like to pass a array of objects back to
>> the JS caller.
>>
>> Any help is greatly appreciated.
>> cheers
>> Reinhard
>>
>>
>>
>> --
>> View this message in context:
>> http://apache-wicket.1842946.n4.nabble.com/using-tp4657363.html
>> Sent from the Users forum mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: 

> [email protected]

>> For additional commands, e-mail: 

> [email protected]

>>
>>
> 
> 
> -- 
> Regards - Ernesto Reinaldo Barreiro
> Antilia Soft
> http://antiliasoft.com/ <http://antiliasoft.com/antilia>





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-pass-a-value-back-to-JS-after-a-AjaxRequest-tp4657363p4657379.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

  • using Reinhard
    • Re: using Reinhard

Reply via email to