[Seaside] Asynchronous message sending and Seaside/Script.aculo.us/JavaScript/AJAX

Rob Withers reefedjib at gmail.com
Mon Sep 20 13:48:13 UTC 2010

I am trying to figure out how I can integrate my asynchronous message sending framework with Seaside.  From my reading, it seems that Seaside works on a request/response model.  Furthermore, with JavaScript/AJAX/Script.aculo.us it still works on a request/response model.  There seems there is no way to "push" events/content.   Is this accurate?

Given that, the only way to do it would be to poll from the browser (using a periodical JavaScript control, perhaps) and process a list of pending results from the asynchronous side.  

For example, I ask for a page which calls #renderContentOn: html.  This method makes an asynchronous call to a  server object, on another server, and returns a promise object immediately.  Normally, I would send #whenResolved: to the promise with my post-result action and when the promise resolves to a real object it would call that block.  Since we are constructing a page, and we will lose immediate control, this will not work.  I cannot callback to the page.  So let's say I store the promise in a pending list with a post-action like building a sub-form.  When the JavaScript timer fires, it calls a #renderContentOn: on some Component, which processes the pending promises and builds the subform to display.   

Would this sort of thing work?   I am a little confused by the fact that the subform the promise builds may be different than the Component the #renderContentOn: is called periodically. 

How could this work?

Many thanks,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20100920/63a6bbcb/attachment.htm

More information about the seaside mailing list