<div dir="ltr">Hi Paul and Esteban,<div><br></div><div>thanks a lot for your answer. I just managed it to create my reports with the >>assignTo: hint.</div><div><br></div><div>I needed an additional js which starts in onComplete: of the load and also has an interval.</div><div>this interval watches if the report is rendered and if yes, stops himself and the report creator interval.</div><div>It took some time for me to understand and find a good way but now I am happy with this solution.</div><div><br></div><div>Before, I had a complete javascript only solution and this was more complicated and did not work sometimes.</div><div><br></div><div>Regards</div><div>Sabine</div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-04-25 16:28 GMT+02:00 Paul DeBruicker [via Smalltalk] <span dir="ltr"><<a href="/user/SendEmail.jtp?type=node&node=4944683&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>></span>:<br><blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

        JSObject has #assignTo: which you can use to assign the interval id returned by the setInterval() js function to a js var name in the browser.  So in your case I might try 
<br><br><br><br>(((html jQuery id: anId) load
<br><span class="">html: [ :r |
<br>...show the report file... ];
<br></span>interval: 2 seconds) assignTo: 'interval',anId
<br><br><br><br>Then later you can clear the interval.
<br><br><br>Another strategy is to use your polling code to set a #timeout: rather than the #interval:.  So the polling code checks to see if the report is ready, if not it sets another timeout to check again in two seconds. 
<br> When the report is ready, it returns the report.  In that way the interval/timeout mess cleans up after itself.  
<br><br><br><br><br><br><br><br><blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' style="border-left:2px solid #cccccc;padding:0 1em" class="m_3985701465103768111quote m_3985701465103768111dark-border-color"><div class="m_3985701465103768111quote m_3985701465103768111light-border-color">
<div class="m_3985701465103768111quote-author" style="font-weight:bold">Sabine Manaa wrote</div>
<div class="m_3985701465103768111quote-message m_3985701465103768111shrinkable-quote"><div><div class="h5">Hi,
<br><br>I use JSObject>>interval: (thanks Johan) for my report generation:
<br>first I show a spinner. Every 2 seconds, I try to reload the reports png
<br>file (it takes a little time to generate it).
<br>This works but I have one final problem: how can I stop the interval?
<br>Four intervals are started each time the user selects a trip and wants the
<br>reports to be shown (there are 4 report types currently). I have to stop
<br>them, if not, they overlap with the old reports.
<br><br>Below is a part of the code I use. As far as I understand, I need an ID of
<br>the interval to call clearInterval(timerId); In the onComplete: of the load
<br>I want to call clearInterval() with this timerId.
<br>html div
<br>...
<br>script:
<br>((html jQuery id: anId) load
<br>html: [ :r |
<br>...show the report file... ];
<br>interval: 2 seconds);
<br><br>It creates this JS
<br><br>setInterval(function(){$("#<wbr>imageVehicleReport").load("/<wbr>RKA",["_s=sW0fUJ73IwxSs_bo","_<wbr>k=b14htm7FJ6AWvWeW","4152"].<wbr>join("&"))},2000)
<br><br>How can I stop it?
<br><br>Regards
<br>Sabine
<br><br></div></div><span class="">______________________________<wbr>_________________
<br>seaside mailing list
<br><a href="http:///user/SendEmail.jtp?type=node&node=4944038&i=0" rel="nofollow" link="external" target="_blank">[hidden email]</a><br><a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" rel="nofollow" link="external" target="_blank">http://lists.squeakfoundation.<wbr>org/cgi-bin/mailman/listinfo/<wbr>seaside</a></span></div>
</div></blockquote>


        
        
        
        <br>
        <br>
        <hr noshade size="1" color="#cccccc">
        <div style="color:#444;font:12px tahoma,geneva,helvetica,arial,sans-serif"><span class="">
                <div style="font-weight:bold">If you reply to this email, your message will be added to the discussion below:</div>
                </span><a href="http://forum.world.st/how-to-stopInterval-which-was-created-by-JSObject-interval-tp4943993p4944038.html" target="_blank" rel="nofollow" link="external">http://forum.world.st/how-to-<wbr>stopInterval-which-was-<wbr>created-by-JSObject-interval-<wbr>tp4943993p4944038.html</a>
        </div><div class="HOEnZb"><div class="h5">
        <div style="color:#666;font:11px tahoma,geneva,helvetica,arial,sans-serif;margin-top:.4em;line-height:1.5em">
                To start a new topic under Seaside General, email <a href="/user/SendEmail.jtp?type=node&node=4944683&i=1" target="_top" rel="nofollow" link="external">[hidden email]</a> <br>
                To unsubscribe from Seaside, <a href="" target="_blank" rel="nofollow" link="external">click here</a>.<br>
                <a href="http://forum.world.st/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" rel="nofollow" style="font:9px serif" target="_blank" link="external">NAML</a>
        </div></div></div></blockquote></div><br></div>


        
        
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://forum.world.st/how-to-stopInterval-which-was-created-by-JSObject-interval-tp4943993p4944683.html">Re: how to stopInterval which was created by JSObject>>interval:</a><br/>
Sent from the <a href="http://forum.world.st/Seaside-General-f86180.html">Seaside General mailing list archive</a> at Nabble.com.<br/>