Explicit rendering of a logging component

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Explicit rendering of a logging component

bachitoph
Hi all,

I try to render a logging component to show the user what my software is doing while he is waiting after clicking on an html anchor. The problem is that I need an explicit refresh of the logging component to show the actual status. I looked in this forum and found "WARenderLoop new call: aComponent" which renders my component fine, but calling this, the code after it, is not longer executed. It does not run to the halt. Any comment welcome.

bookingsClose
    |file|
    self markets do: [:market|
        file := market createExcelFile.
        self loggingComponent addMessage: market name , ' Excel file created'.
        WARenderLoop new call: self loggingComponent. "Explicit render loggingComponent"
        self halt.
        market emailSend: file.
        self loggingComponent addMessage: market name , ' Email sended'.
        WARenderLoop new call: self loggingComponent. "Explicit render loggingComponent"
        ...].

thanks in forward

 
Reply | Threaded
Open this post in threaded view
|

Re: Explicit rendering of a logging component

Lukas Renggli
Hi,

have a look at the documentation in #call:. Sending this message
blocks the execution of the code and sends a response to the
web-server. The code only resumes when you do an answer from the
component and that you can only trigger from the client.

You need to take a different approach. First, you need to fork the
long task into a separate process as Seaside only processes on request
per session at a time. Second, updating a page from the server is not
possible without the use of Javascript on the client, HTTP does not
provide a mechanism to display something new on the client without
that the client asks for it. You can either use Javascript to
regularly poll for updates (easy), or use Comet to stream changes to
the client (tricky).

Check out the mailing list archive, there were several threads about
this in the past.

Cheers,
Lukas

On Thu, May 14, 2009 at 12:19 PM, Zirbler <[hidden email]> wrote:

>
> Hi all,
>
> I try to render a logging component to show the user what my software is
> doing while he is waiting after clicking on an html anchor. The problem is
> that I need an explicit refresh of the logging component to show the actual
> status. I looked in this forum and found "WARenderLoop new call: aComponent"
> which renders my component fine, but calling this, the code after it, is not
> longer executed. It does not run to the halt. Any comment welcome.
>
> bookingsClose
>    |file|
>    self markets do: [:market|
>        file := market createExcelFile.
>        self loggingComponent addMessage: market name , ' Excel file
> created'.
>        WARenderLoop new call: self loggingComponent. "Explicit render
> loggingComponent"
>        self halt.
>        market emailSend: file.
>        self loggingComponent addMessage: market name , ' Email sended'.
>        WARenderLoop new call: self loggingComponent. "Explicit render
> loggingComponent"
>        ...].
>
> thanks in forward
>
>
> --
> View this message in context: http://www.nabble.com/Explicit-rendering-of-a-logging-component-tp23537835p23537835.html
> Sent from the Squeak - Seaside mailing list archive at Nabble.com.
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>



--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Explicit rendering of a logging component

bachitoph
Hi Lukas,

thanks for your explaination and showing me the direction to go.

Christoph J. Bachinger


Lukas Renggli wrote
Hi,

have a look at the documentation in #call:. Sending this message
blocks the execution of the code and sends a response to the
web-server. The code only resumes when you do an answer from the
component and that you can only trigger from the client.

You need to take a different approach. First, you need to fork the
long task into a separate process as Seaside only processes on request
per session at a time. Second, updating a page from the server is not
possible without the use of Javascript on the client, HTTP does not
provide a mechanism to display something new on the client without
that the client asks for it. You can either use Javascript to
regularly poll for updates (easy), or use Comet to stream changes to
the client (tricky).

Check out the mailing list archive, there were several threads about
this in the past.

Cheers,
Lukas

On Thu, May 14, 2009 at 12:19 PM, Zirbler <cj-bachinger@gmx.de> wrote:
>
> Hi all,
>
> I try to render a logging component to show the user what my software is
> doing while he is waiting after clicking on an html anchor. The problem is
> that I need an explicit refresh of the logging component to show the actual
> status. I looked in this forum and found "WARenderLoop new call: aComponent"
> which renders my component fine, but calling this, the code after it, is not
> longer executed. It does not run to the halt. Any comment welcome.
>
> bookingsClose
>    |file|
>    self markets do: [:market|
>        file := market createExcelFile.
>        self loggingComponent addMessage: market name , ' Excel file
> created'.
>        WARenderLoop new call: self loggingComponent. "Explicit render
> loggingComponent"
>        self halt.
>        market emailSend: file.
>        self loggingComponent addMessage: market name , ' Email sended'.
>        WARenderLoop new call: self loggingComponent. "Explicit render
> loggingComponent"
>        ...].
>
> thanks in forward
>
>
> --
> View this message in context: http://www.nabble.com/Explicit-rendering-of-a-logging-component-tp23537835p23537835.html
> Sent from the Squeak - Seaside mailing list archive at Nabble.com.
>
> _______________________________________________
> seaside mailing list
> seaside@lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>



--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
seaside mailing list
seaside@lists.squeakfoundation.org
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside