[Seaside] Re: Q on Periodical

Bob Arning arning at charm.net
Sun Oct 9 18:37:20 UTC 2011


I'm not sure why you want to create the periodical before you need it to 
run, but this seems to do what you wanted:

renderContentOn: html

     html div
         script: ((html scriptaculous periodical)
             frequency: 1;
             on: #renderNextImageOn: of: self;
             assignTo: 'FLPer'
             ), (
                 html prototype script add: (JSStream new
                     nextPutAll: 'FLPer.stop();';
                     yourself)
                 );

         with: [html text: 'this is a test'].
     html div
         onClick: ('FLPer.start();');
         with: 'start me'.
     html div
         onClick: ('FLPer.stop();');
         with: 'stop me'.

Cheers,
Bob

On 10/9/11 12:22 PM, squeakman wrote:
> That is exactly what I tried (in addition to the "evalScripts: false") 
> but it seems that the Periodical is always triggered once initially. 
> What I observed is that it is triggered once on creation.
>
> Below is the code I tried to initially turn it off - but seemingly to 
> no avail.
>
> >> html script: ((html scriptaculous periodical)
> >> id: self domId;
> >> frequency: 5;
> >> on: self triggerMethod of: self parent;
> >> evalScripts: false;
> >> assignTo: 'FLPer').
>
> html script: 'FLPer.stop();'.    "turn off initially"
>
>
> And, as an aside, shouldn't the evalScripts: false result in it not 
> running or is my understanding incorrect?
>
> Thanks for your help,
> Frank
>
> On 09/10/2011 11:28 AM, Sebastian Sastre wrote:
>> put it in a variable and stop it just after creating it.
>> that way, it never executes until you tell it to start again
>>
>>
>>
>>
>> On Oct 9, 2011, at 12:03 PM, squeakman wrote:
>>
>>> Hello,
>>>
>>> Is there any way to setup a periodical but not have it running 
>>> initially?
>>>
>>> I guessed that using "evalScripts: false" would result in the script
>>> not being executed but that did not work.
>>>
>>> Here is the code that I am using:
>>>
>>> html script: ((html scriptaculous periodical)
>>> id: self domId;
>>> frequency: 5;
>>> on: self triggerMethod of: self parent;
>>> evalScripts: false;
>>> assignTo: 'FLPer').
>>>
>>>
>>> What I want to do is have the script assigned to the javascript
>>> variable "FLPer" but not have it executed until a later time.
>>>
>>> Thanks for any help you can provide,
>>>
>>> Frank
>>>
>>> _______________________________________________
>>> seaside mailing list
>>> seaside at lists.squeakfoundation.org
>>> <mailto:seaside at lists.squeakfoundation.org>
>>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>
>> sebastian <http://about.me/sebastianconcept>
>>
>> o/
>>
>>
>>
>>
>>
>> _______________________________________________
>> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20111009/e3dea9f2/attachment-0001.htm


More information about the seaside mailing list