[Seaside] Keep-alive timer for Seaside app

Tony Fleig tony.fleig at gmail.com
Thu Jan 6 16:53:57 UTC 2011


Maybe this is more complex than I thought:

When I use my original script:

| script cacheTimeout |	
	cacheTimeout := self session application cache expiryPolicy
configuration at: #cacheTimeout.
	script := JSScript new
				add: (JSScript new
					add: (html jQuery ajax callback: [ ]));
				interval: (cacheTimeout - 60) seconds asDuration.				
	html document addLoadScript: script.

everything works fine. And by that I mean scripts elsewhere in the app
are executed normally, for example this one:

		html checkbox
			value: (self items at: k);
			onChange: ( 'updateItemStatus($(this));');
			onChange: (html jQuery ajax callback: [
				Transcript cr; show: 'callback'])

However, if I change my load script to this:

| script cacheTimeout |	
	cacheTimeout := self session application cache expiryPolicy
configuration at: #cacheTimeout.
	html document addLoadScript: (
		html script: (
			html jQuery ajax
				callback: [];
				interval: (cacheTimeout - 60) seconds))

The checkbox onChange script and callback never happen.

I don't understand what is going on here. Somehow the load script is
interfering with ajax execution elsewhere on the page. Inspection of
the source code has revealed nothing obvious to me.

I'm sure there is some piece of Seaside that I don't understand here.
Can anyone help me understand what's going on?

Cheers,
TF



On Thu, Jan 6, 2011 at 3:13 AM, Esteban Lorenzano <estebanlm at gmail.com> wrote:
> I do this:
>
>        html script: (html jQuery ajax
>                callback: [ "Do nothing" ];
>                interval: self interval)
>
> you really don't need a response to client side :)
>
> Cheers,
> Esteban
>
> El 06/01/2011, a las 3:46a.m., Lukas Renggli escribió:
>
>>> My questions are:
>>>    Is there better way to do this?
>>>    Is there an easier way to get the cacheTimeout value?
>>
>> Looks good.
>>
>>>    Do I really need two JSScript instances to create the interval
>>> timer? I couldn't find a better solution.
>>
>> You should be able to send #interval: to the JQAjax instance with a
>> cascade (same receiver as #callback:). No need for JSScript.
>>
>> Lukas
>>
>> --
>> Lukas Renggli
>> www.lukas-renggli.ch
>> _______________________________________________
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>


More information about the seaside mailing list