[Seaside] question about callbacks in listboxes.
Timothy James Ziebart
timothy at churchmilitant.org
Mon May 3 18:31:08 UTC 2010
Ok, so the callback, in this case,
*callback: [ :value | self citySelectionChanged: value ]; *
onChange: ((html jQuery id: self liveHoodId) load html: [:r |
self renderHoodListOn: r] );
onChange: ((html jQuery id: 's_results') load serializeThis;
html: [ :r | self renderStatusPanelOn: r. self
renderResultsOn: r ] )
will only be executed when the "serializeThis" is fired?
On 10-05-03 11:21 AM, Lukas Renggli wrote:
>> Thanks Lukas, I understand that about AJAX and in this case the rendering
>> order does not matter. I was expecting the callback to complete before
>> either AJAX request is fired. Is this not correct?
> Seaside only controls the order within a *single* AJAX request. In
> your code you do two requests, but only serializes the list in one.
>> On 10-05-03 11:12 AM, Lukas Renggli wrote:
>>>> onChange: ((html jQuery id: self liveHoodId) load html: [:r | self
>>>> renderHoodListOn: r] );
>>>> onChange: ((html jQuery id: 's_results') load serializeThis;
>>>> html: [ :r | self renderStatusPanelOn: r. self
>>>> renderResultsOn: r ] )
>>> AJAX is asynchronous. You trigger off two AJAX requests concurrently
>>> that arrive in an undefined order at the server. Combine them to one
>>> request (I strongly suggest that, this is much more efficient) to get
>>> deterministic behavior. Alternatively you can also keep the two
>>> requests, but only start the second one when the first completed.
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the seaside