<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Sabine,<br>
      <br>
      I think you need to fork  a new (background) process in order to
      have it run independently of the Ajax callbacks. The Ajax
      callbacks will be executed one after the other, there will never
      be any progress reporting.<br>
      <br>
      So I THINK what you absolutely have to do is to start the long
      running Ajax callback as another process. <br>
      <br>
      So start by putting your sequence of process steps in a <br>
      <br>
      [ <br>
       ] fork.<br>
      <br>
      block and see if it improves things.<br>
      <br>
      <br>
      I am using an inst var of the component instead of the session,
      but I guess that doesn't really matter. Using the session is
      probably a much better idea because you could then use this
      facility for a general solution that works for all ajax callbacks
      that run longer...<br>
      <br>
      <br>
      HTH<br>
      <br>
      Joachim<br>
      <br>
      <br>
      <br>
      Am 21.07.17 um 17:31 schrieb Sabine Manaa:<br>
    </div>
    <blockquote
cite="mid:CA+UbgZb0-88Jr01tU=y73C=TM6Tht8rxJ4xBGeRNbP9=Fk3utg@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi Joachim, all,
        <div><br>
        </div>
        <div>thanks a lot! I think I am very near to the solution but
          there is one problem remaining: within the Ajax block, the
          JQLoad   seems to be "blocked". I explain:</div>
        <div><br>
        </div>
        <div>* I have an attribute @directUserMessage: in my session
          initialized with an empty string.<br>
        </div>
        <div><br>
        </div>
        <div>*In my main view I have
          >>renderLoadIntervalMessageOn: html</div>
        <div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>html
          paragraph</div>
        <div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>id:
          'spf-direct-message';</div>
        <div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>script:</div>
        <div><span class="gmail-Apple-tab-span" style="white-space:pre">                        </span>(html
          jQuery this load</div>
        <div><span class="gmail-Apple-tab-span" style="white-space:pre">                                </span>onComplete:</div>
        <div><span class="gmail-Apple-tab-span" style="white-space:pre">                                        </span>('
          javascript which shows the snackbar if spa-direct-message is
          set'));</div>
        <div><span class="gmail-Apple-tab-span" style="white-space:pre">                                </span>html:
          [ :r | self renderMessageOn: r ];</div>
        <div><span class="gmail-Apple-tab-span" style="white-space:pre">                                </span>interval:
          1 seconds);</div>
        <div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>with:
          [ self renderMessageOn: html ]</div>
        <div><br>
        </div>
        <div> >>renderMessageOn: html<br>
        </div>
        <div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>self
          session directUserMessage isEmpty</div>
        <div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>ifFalse:
          [ html render: self session directUserMessage ]</div>
        <div><br>
        </div>
        <div class="gmail_extra"><br>
          <div class="gmail_quote">I have my button invoking the report
            generation: </div>
          <div class="gmail_quote"><br>
          </div>
          <div class="gmail_quote">
            <div class="gmail_quote">onClick:</div>
            <div class="gmail_quote"><span class="gmail-Apple-tab-span" style="white-space:pre">      </span>(html
              jQuery ajax<br>
            </div>
            <div class="gmail_quote"><span class="gmail-Apple-tab-span" style="white-space:pre">              </span>script:
              [ :script | </div>
            <div class="gmail_quote"><span class="gmail-Apple-tab-span" style="white-space:pre">              </span>self
              session generateReportFiles: script.</div>
            <div class="gmail_quote"><span class="gmail-Apple-tab-span" style="white-space:pre">      </span> ...]);</div>
            <div class="gmail_quote"><span class="gmail-Apple-tab-span" style="white-space:pre">              </span>with:
              'PDF'.</div>
            <div class="gmail_quote"><br>
            </div>
            <div class="gmail_quote">in >>generateReportFiles:</div>
            <div class="gmail_quote">"i set the directUserMessages:"</div>
            <div class="gmail_quote">self session directUserMessage:
              'Erstelle Reisekostenabrechnungen, bitte warten...'.</div>
            <div class="gmail_quote"><span class="gmail-Apple-tab-span" style="white-space:pre">      </span>RKAPDFWriter
              new createCostReports: self.</div>
            <div class="gmail_quote"><span class="gmail-Apple-tab-span" style="white-space:pre">      </span>self
              session directUserMessage: 'Erstelle Belege, bitte
              warten...'.</div>
            <div class="gmail_quote"><span class="gmail-Apple-tab-span" style="white-space:pre">      </span>RKAPDFWriter
              new createReceiptReports: self.</div>
            <div class="gmail_quote"><span class="gmail-Apple-tab-span" style="white-space:pre">      </span>self
              session directUserMessage: 'Erstelle Fahrten, bitte
              warten...'.</div>
            <div class="gmail_quote"><span class="gmail-Apple-tab-span" style="white-space:pre">      </span>RKAPDFWriter
              new createVehicleReports: self.</div>
            <div class="gmail_quote"><span class="gmail-Apple-tab-span" style="white-space:pre">      </span>self
              session directUserMessage: 'Erstelle Buchungen, bitte
              warten...'.</div>
            <div class="gmail_quote"><span class="gmail-Apple-tab-span" style="white-space:pre">      </span>RKAPDFWriter
              new createBookingReports: self.</div>
            <div class="gmail_quote"><span class="gmail-Apple-tab-span" style="white-space:pre">      </span>self
              session directUserMessage: ''</div>
            <div class="gmail_quote"><br>
            </div>
            <div class="gmail_quote">I tried I with a test button:</div>
            <div class="gmail_quote">
              <div class="gmail_quote"><span class="gmail-Apple-tab-span" style="white-space:pre">    </span>html
                mdlButton</div>
              <div class="gmail_quote"><span class="gmail-Apple-tab-span" style="white-space:pre">            </span>onClick:<br>
              </div>
              <div class="gmail_quote"><span class="gmail-Apple-tab-span" style="white-space:pre">                     </span> (html
                jQuery ajax script: [ :script | self session
                directUserMessage: 'test' ]);</div>
              <div class="gmail_quote"><span class="gmail-Apple-tab-span" style="white-space:pre">            </span>with:
                'set message'</div>
              <div class="gmail_quote"><br>
              </div>
              <div class="gmail_quote">this works perfect - after
                clicking on the test button, the snackbar is showing
                every second again.</div>
              <div class="gmail_quote">So, I can say that the principle
                was clear and I have a possibility to show individual
                messages by setting the string in the session.</div>
              <div class="gmail_quote"><br>
              </div>
              <div class="gmail_quote">BUT: while I am in the Ajax
                block, it does not work.</div>
              <div class="gmail_quote">I put a console.log() into the
                javascript code and AFTER finishing the Ajax, all the
                messages are put there.</div>
              <div class="gmail_quote">It seems to wait till the Ajax
                call is finished.</div>
              <div class="gmail_quote"><br>
              </div>
              <div class="gmail_quote">I have put an output  into the
                transcript: </div>
              <div class="gmail_quote"><br>
              </div>
              <div class="gmail_quote">
                <div class="gmail_quote">renderMessageOn: html</div>
                <div class="gmail_quote"><span class="gmail-Apple-tab-span" style="white-space:pre">  </span>Transcript
                  crShow: Time now printString , '-' , self session
                  directUserMessage.</div>
                <div class="gmail_quote"><br>
                </div>
                <div class="gmail_quote">and there I see, that while I
                  am in the Ajax block, there is no output.</div>
                <div class="gmail_quote">While I am not in the Ajax
                  block, it renders the time into it each second.</div>
              </div>
              <div class="gmail_quote"><br>
              </div>
              <div class="gmail_quote">What is wrong here, can anyone
                explain?</div>
              <div class="gmail_quote">Joachim, do you also set the
                instance variable with the text from an Ajax block? </div>
              <div class="gmail_quote"><br>
              </div>
              <div class="gmail_quote">Regards</div>
              <div class="gmail_quote">Sabine</div>
              <div class="gmail_quote"><br>
              </div>
              <div class="gmail_quote"><br>
              </div>
              <div class="gmail_quote"><br>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <hr align="left" width="300">
      View this message in context: <a moz-do-not-send="true"
href="http://forum.world.st/immediate-display-alert-to-user-while-Ajax-request-tp4956083p4956113.html">Re:
        immediate display alert to user while Ajax request</a><br>
      Sent from the <a moz-do-not-send="true"
        href="http://forum.world.st/Seaside-General-f86180.html">Seaside
        General mailing list archive</a> at Nabble.com.<br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
seaside mailing list
<a class="moz-txt-link-abbreviated" href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a>
<a class="moz-txt-link-freetext" href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a>
</pre>
    </blockquote>
    <br>
    <p><br>
    </p>
    <pre class="moz-signature" cols="72">-- 
-----------------------------------------------------------------------
Objektfabrik Joachim Tuchel          <a class="moz-txt-link-freetext" href="mailto:jtuchel@objektfabrik.de">mailto:jtuchel@objektfabrik.de</a>
Fliederweg 1                         <a class="moz-txt-link-freetext" href="http://www.objektfabrik.de">http://www.objektfabrik.de</a>
D-71640 Ludwigsburg                  <a class="moz-txt-link-freetext" href="http://joachimtuchel.wordpress.com">http://joachimtuchel.wordpress.com</a>
Telefon: +49 7141 56 10 86 0         Fax: +49 7141 56 10 86 1

</pre>
  </body>
</html>