[Seaside] Re: Differences in calling render: from ajax?

TimM tamackinnon at gmail.com
Mon Aug 16 14:18:26 UTC 2010


Nick Ager wrote:

> if it's javascript you're using to force a reload, you can try:
> 
> ^ 'window.location.reload();'
> 
> or more brute force:
> 
> ^ 'window.location.href= "', self requestContext request 
> uri withoutQuery greaseString, '"'    [untested]
> 
> 
> - I don't know if there are any Smalltalk javascript mappings for these.

Thanks Nick - I finally tracked down my problem - don't do:

self pusher javascript: [ :jsScript |
		jsScript << (self generateUpdateScriptWith: jsScript) ]

And then in generateUpdateScriptWith: jsScript

	^aJScript goto: anActionUrl withoutQuery

Its very subtle, but << is appending something that you've already added 
to the JSScript collection (above), and so it gets it knickers in a big 
knot and hangs the VM (should that be possible?).

So now I've come full circle, I can update my page with components that 
have callbacks. but now because I'm reloading my page - my ajax call to 
make a noise gets lost (because the page is re-loading). Sigh...

Maybe an IFrame? Or maybe a url parameter that signals to make a noise?

Its all a bit yucky - its a shame I don't know enough to tidy up the 
comet pusher (or if it even can be tidied to handle callbacks).

Tim



More information about the seaside mailing list