[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?
Tim
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.
>
> Lukas
>
>
>
>> 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.
>>>
>>> Lukas
>>>
>>>
>>>
>> _______________________________________________
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>
>>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20100503/7994894d/attachment.htm
More information about the seaside
mailing list