[Seaside] wait for callback and use results of return value
johan at inceptive.be
Wed Nov 21 21:49:15 UTC 2018
I assume you need to pass a callback function as argument to `getS3Data` that will be called when the result data is ready?
The following wraps the Ajax call in a function with one argument and passes it as an argument to `getS3Data’.
Invoking the function with a value invokes the ajax request with the given value.
((html jQuery ajax
callback: [ :var | var inspect ]
Does this come close?
> On 21 Nov 2018, at 14:56, Sabine Manaa <manaa.sabine at gmail.com> wrote:
> I have spent several hours in the following problem: I want to use a list of
> names in Pharo which I get from amazon S3. But it is not a aws problem but a
> problem of understanding how to use callbacks/asynchronus code and return
> values. This is a simplified version for describing the problem. Pressing
> to use in Pharo is the result which is at *1*. But the method immediately
> returns the result at *2*, because it dose not wait for the function to be
> similar problem.
> Perhaps someone has an idea. I already tried with promises but did not
> renderTestOn: html
> html div
> (html jQuery ajax callback: [ :var | var inspect ] value: (JSStream on:
> with: 'testing'
> Sent from: http://forum.world.st/Seaside-General-f86180.html
> seaside mailing list
> seaside at lists.squeakfoundation.org
More information about the seaside