[Seaside] Keep-alive timer for Seaside app

Tony Fleig tony.fleig at gmail.com
Thu Jan 6 18:09:16 UTC 2011


A follow-up:

If I do not use addLoadScript: and just render the script to the page,
then the problem disappears.

Is it the case that jQuery ajax scripts in the load scripts can
inhibit ajax execution for the whole app?

Why does my original script not cause the problem when it is used as a
load script?

I compared the generated Javascript and the same code is generated
regardless of whether the script is loaded using addLoadScript: or
not.

TF

On Thu, Jan 6, 2011 at 8:53 AM, Tony Fleig <tony.fleig at gmail.com> wrote:
> 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