<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 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 href="http://forum.world.st/Seaside-General-f86180.html">Seaside General mailing list archive</a> at Nabble.com.<br/>