Comet pattern explained on our website

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

Comet pattern explained on our website

Janko Mivšek
Dear all,

I open a special page for Comet pattern on our website:

        http://www.aidaweb.si/comet.html       

There you'll find a description of Comet and how it is supported in Aida
as a pattern, because there is no special additional code for Comet in
Aida, you are just using usual periodic updater, set to say 1h, but
server delays the answer to this Ajax request until some interesting
event happen to be worth refreshing the page.

There is also an example how to implement the Comet pattern using the
Announcement event framework, which is preferable way to go.

Best regards
Janko

--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Comet pattern explained on our website

Rob Rothwell
Maybe this is a question I should have asked long ago.

What are the benefits of just checking for an update every now and then with plain old Ajax, versus waiting for something to happen?

Would I be better off just polling for changes every few seconds?

Thanks,

Rob

On Tue, Mar 3, 2009 at 8:54 AM, Janko Mivšek <[hidden email]> wrote:
Dear all,

I open a special page for Comet pattern on our website:

       http://www.aidaweb.si/comet.html

There you'll find a description of Comet and how it is supported in Aida
as a pattern, because there is no special additional code for Comet in
Aida, you are just using usual periodic updater, set to say 1h, but
server delays the answer to this Ajax request until some interesting
event happen to be worth refreshing the page.

There is also an example how to implement the Comet pattern using the
Announcement event framework, which is preferable way to go.

Best regards
Janko

--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida


_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Comet pattern explained on our website

Rob Rothwell
Hah!

I think your initial

liveContent updateEverySeconds: 3600.

should be a very SHORT update:

liveContent updateEverySeconds: 1.

Then you put the long delay in the waitForAnyChange method, just like you did.

The "outer" Ajax short update will never fire until after you fall through the waitForAnyChange method, which will only happen after receiving an announcement or the count is reached.

I don't know why I never got that right before...

Rob


On Tue, Mar 3, 2009 at 1:26 PM, Rob Rothwell <[hidden email]> wrote:
Maybe this is a question I should have asked long ago.

What are the benefits of just checking for an update every now and then with plain old Ajax, versus waiting for something to happen?

Would I be better off just polling for changes every few seconds?

Thanks,

Rob


On Tue, Mar 3, 2009 at 8:54 AM, Janko Mivšek <[hidden email]> wrote:
Dear all,

I open a special page for Comet pattern on our website:

       http://www.aidaweb.si/comet.html

There you'll find a description of Comet and how it is supported in Aida
as a pattern, because there is no special additional code for Comet in
Aida, you are just using usual periodic updater, set to say 1h, but
server delays the answer to this Ajax request until some interesting
event happen to be worth refreshing the page.

There is also an example how to implement the Comet pattern using the
Announcement event framework, which is preferable way to go.

Best regards
Janko

--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida



_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Comet pattern explained on our website

Damir Horvat-2
In reply to this post by Rob Rothwell
On Tue, 3 Mar 2009 13:26:17 -0500, Rob Rothwell <[hidden email]>
wrote:
> Maybe this is a question I should have asked long ago.
>
> What are the benefits of just checking for an update every now and then
> with
> plain old Ajax, versus waiting for something to happen?
>
> Would I be better off just polling for changes every few seconds?

Hi!

If you have one client, polling is ok. If you have 100 clients, well
that's a bit more traffic every second...

Also, long poll has 'server event' kinda effect. Client gets page update
without any action from his side - server initiates the change.

Hope this helps.

Damir
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Comet pattern explained on our website

Janko Mivšek
In reply to this post by Rob Rothwell
Rob Rothwell pravi:
> Hah!
>
> I think your initial
>
> liveContent updateEverySeconds: 3600.
>
> should be a very SHORT update:
>
> liveContent updateEverySeconds: 1.

Yes, you are right! Bad me, how come I didn't thing that way! Well I
actually did that way in original code, just somehow felt it is wrong...

I already updated the webpage. Sorry guys!

Janko

>
> Then you put the long delay in the waitForAnyChange method, just like
> you did.
>
> The "outer" Ajax short update will never fire until after you fall
> through the waitForAnyChange method, which will only happen after
> receiving an announcement or the count is reached.
>
> I don't know why I never got that right before...
>
> Rob
>
>
> On Tue, Mar 3, 2009 at 1:26 PM, Rob Rothwell <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Maybe this is a question I should have asked long ago.
>
>     What are the benefits of just checking for an update every now and
>     then with plain old Ajax, versus waiting for something to happen?
>
>     Would I be better off just polling for changes every few seconds?
>
>     Thanks,
>
>     Rob
>
>
>     On Tue, Mar 3, 2009 at 8:54 AM, Janko Mivšek
>     <[hidden email] <mailto:[hidden email]>> wrote:
>
>         Dear all,
>
>         I open a special page for Comet pattern on our website:
>
>                http://www.aidaweb.si/comet.html
>
>         There you'll find a description of Comet and how it is supported
>         in Aida
>         as a pattern, because there is no special additional code for
>         Comet in
>         Aida, you are just using usual periodic updater, set to say 1h, but
>         server delays the answer to this Ajax request until some interesting
>         event happen to be worth refreshing the page.
>
>         There is also an example how to implement the Comet pattern
>         using the
>         Announcement event framework, which is preferable way to go.
>
>         Best regards
>         Janko

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Comet pattern explained on our website

Rob Rothwell
Thanks everyone for the help!

It seems to be working just fine...

Rob

On Tue, Mar 3, 2009 at 3:31 PM, Janko Mivšek <[hidden email]> wrote:
Rob Rothwell pravi:
> Hah!
>
> I think your initial
>
> liveContent updateEverySeconds: 3600.
>
> should be a very SHORT update:
>
> liveContent updateEverySeconds: 1.

Yes, you are right! Bad me, how come I didn't thing that way! Well I
actually did that way in original code, just somehow felt it is wrong...

I already updated the webpage. Sorry guys!

Janko

>
> Then you put the long delay in the waitForAnyChange method, just like
> you did.
>
> The "outer" Ajax short update will never fire until after you fall
> through the waitForAnyChange method, which will only happen after
> receiving an announcement or the count is reached.
>
> I don't know why I never got that right before...
>
> Rob
>
>
> On Tue, Mar 3, 2009 at 1:26 PM, Rob Rothwell <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Maybe this is a question I should have asked long ago.
>
>     What are the benefits of just checking for an update every now and
>     then with plain old Ajax, versus waiting for something to happen?
>
>     Would I be better off just polling for changes every few seconds?
>
>     Thanks,
>
>     Rob
>
>
>     On Tue, Mar 3, 2009 at 8:54 AM, Janko Mivšek
>     <[hidden email] <mailto:[hidden email]>> wrote:
>
>         Dear all,
>
>         I open a special page for Comet pattern on our website:
>
>                http://www.aidaweb.si/comet.html
>
>         There you'll find a description of Comet and how it is supported
>         in Aida
>         as a pattern, because there is no special additional code for
>         Comet in
>         Aida, you are just using usual periodic updater, set to say 1h, but
>         server delays the answer to this Ajax request until some interesting
>         event happen to be worth refreshing the page.
>
>         There is also an example how to implement the Comet pattern
>         using the
>         Announcement event framework, which is preferable way to go.
>
>         Best regards
>         Janko

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida


_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Comet pattern explained on our website

Janko Mivšek
Rob Rothwell pravi:

> Thanks everyone for the help!
> It seems to be working just fine...

Already? Well, that's quick! So you have your project over the biggest
obstacle now?

Janko


> On Tue, Mar 3, 2009 at 3:31 PM, Janko Mivšek <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Rob Rothwell pravi:
>     > Hah!
>     >
>     > I think your initial
>     >
>     > liveContent updateEverySeconds: 3600.
>     >
>     > should be a very SHORT update:
>     >
>     > liveContent updateEverySeconds: 1.
>
>     Yes, you are right! Bad me, how come I didn't thing that way! Well I
>     actually did that way in original code, just somehow felt it is wrong...
>
>     I already updated the webpage. Sorry guys!
>
>     Janko
>
>     >
>     > Then you put the long delay in the waitForAnyChange method, just like
>     > you did.
>     >
>     > The "outer" Ajax short update will never fire until after you fall
>     > through the waitForAnyChange method, which will only happen after
>     > receiving an announcement or the count is reached.
>     >
>     > I don't know why I never got that right before...
>     >
>     > Rob
>     >
>     >
>     > On Tue, Mar 3, 2009 at 1:26 PM, Rob Rothwell
>     <[hidden email] <mailto:[hidden email]>
>     > <mailto:[hidden email] <mailto:[hidden email]>>>
>     wrote:
>     >
>     >     Maybe this is a question I should have asked long ago.
>     >
>     >     What are the benefits of just checking for an update every now and
>     >     then with plain old Ajax, versus waiting for something to happen?
>     >
>     >     Would I be better off just polling for changes every few seconds?
>     >
>     >     Thanks,
>     >
>     >     Rob
>     >
>     >
>     >     On Tue, Mar 3, 2009 at 8:54 AM, Janko Mivšek
>     >     <[hidden email] <mailto:[hidden email]>
>     <mailto:[hidden email] <mailto:[hidden email]>>>
>     wrote:
>     >
>     >         Dear all,
>     >
>     >         I open a special page for Comet pattern on our website:
>     >
>     >                http://www.aidaweb.si/comet.html
>     >
>     >         There you'll find a description of Comet and how it is
>     supported
>     >         in Aida
>     >         as a pattern, because there is no special additional code for
>     >         Comet in
>     >         Aida, you are just using usual periodic updater, set to
>     say 1h, but
>     >         server delays the answer to this Ajax request until some
>     interesting
>     >         event happen to be worth refreshing the page.
>     >
>     >         There is also an example how to implement the Comet pattern
>     >         using the
>     >         Announcement event framework, which is preferable way to go.
>     >
>     >         Best regards
>     >         Janko
>
>     _______________________________________________
>     Aida mailing list
>     [hidden email] <mailto:[hidden email]>
>     http://lists.aidaweb.si/mailman/listinfo/aida
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Aida mailing list
> [hidden email]
> http://lists.aidaweb.si/mailman/listinfo/aida

--
Janko Mivšek
Svetovalec za informatiko
Eranova d.o.o.
Ljubljana, Slovenija
www.eranova.si
tel:  01 514 22 55
faks: 01 514 22 56
gsm: 031 674 565
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Comet pattern explained on our website

Rob Rothwell
On Tue, Mar 3, 2009 at 4:04 PM, Janko Mivšek <[hidden email]> wrote:
Rob Rothwell pravi:

> Thanks everyone for the help!
> It seems to be working just fine...

Already? Well, that's quick! So you have your project over the biggest
obstacle now?

;)

Well...next I'll be asking nico questions about graphing!

We have some heavy-duty computing that we need to do as a separate process to predict capacity, staffing, etc..., and we want the display to update automatically.

For now we just wanted to do some simulations using historical data (say where every minute represents a day, or something like that...), but build the app to handle real time data.

So...histograms, anyone?  Point me in the right direction???  I know I saw some stuff nico had done a while back...

Thank you for the help!

Rob

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Comet pattern explained on our website

Rob Rothwell
Ok...so I found AidaCharts...very nice...but it will not display if I do something like:

liveContent
    |e|
    self session lastRequest isAjaxRequest ifTrue: [self waitForAnyChange].
    e:=WebElement new.
    e addText: self textToDisplay.
    e addBreak; addBreak.
    e add: self liveChart.
    ^e

Where liveChart just produces a simple, static chart for now:

liveChart
    |e chart|
    e := WebElement new.
    chart := WebChart new addData: {1@2. 2@3. 3@4. 4@5}.
    e add: chart.
    ^e.

I think I do not understand something about Ajax!

Rob

On Tue, Mar 3, 2009 at 4:33 PM, Rob Rothwell <[hidden email]> wrote:
On Tue, Mar 3, 2009 at 4:04 PM, Janko Mivšek <[hidden email]> wrote:
Rob Rothwell pravi:

> Thanks everyone for the help!
> It seems to be working just fine...

Already? Well, that's quick! So you have your project over the biggest
obstacle now?

;)

Well...next I'll be asking nico questions about graphing!

We have some heavy-duty computing that we need to do as a separate process to predict capacity, staffing, etc..., and we want the display to update automatically.

For now we just wanted to do some simulations using historical data (say where every minute represents a day, or something like that...), but build the app to handle real time data.

So...histograms, anyone?  Point me in the right direction???  I know I saw some stuff nico had done a while back...

Thank you for the help!

Rob


_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Comet pattern explained on our website

Rob Rothwell
Sorry...or even:

liveContent
    |e chart|
    self session lastRequest isAjaxRequest ifTrue: [self waitForAnyChange].
    e:=WebElement new.
    e addText: self textToDisplay.
    chart := WebChart new addData: {1@2. 2@3. 3@4. 4@5}.
    e addBreak; addBreak.
    e add: chart.
    ^e

Rob

On Tue, Mar 3, 2009 at 5:07 PM, Rob Rothwell <[hidden email]> wrote:
Ok...so I found AidaCharts...very nice...but it will not display if I do something like:

liveContent
    |e|
    self session lastRequest isAjaxRequest ifTrue: [self waitForAnyChange].
    e:=WebElement new.
    e addText: self textToDisplay.
    e addBreak; addBreak.
    e add: self liveChart.
    ^e

Where liveChart just produces a simple, static chart for now:

liveChart
    |e chart|
    e := WebElement new.
    chart := WebChart new addData: {1@2. 2@3. 3@4. 4@5}.
    e add: chart.
    ^e.

I think I do not understand something about Ajax!

Rob


On Tue, Mar 3, 2009 at 4:33 PM, Rob Rothwell <[hidden email]> wrote:
On Tue, Mar 3, 2009 at 4:04 PM, Janko Mivšek <[hidden email]> wrote:
Rob Rothwell pravi:

> Thanks everyone for the help!
> It seems to be working just fine...

Already? Well, that's quick! So you have your project over the biggest
obstacle now?

;)

Well...next I'll be asking nico questions about graphing!

We have some heavy-duty computing that we need to do as a separate process to predict capacity, staffing, etc..., and we want the display to update automatically.

For now we just wanted to do some simulations using historical data (say where every minute represents a day, or something like that...), but build the app to handle real time data.

So...histograms, anyone?  Point me in the right direction???  I know I saw some stuff nico had done a while back...

Thank you for the help!

Rob



_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Comet pattern explained on our website

Nicolas Petton
Hi,

Do charts work without using ajax?

If so, can you email me the html source of your page with the chart not
diplayed?

Cheers!

Nico


Le mardi 03 mars 2009 à 17:12 -0500, Rob Rothwell a écrit :

> Sorry...or even:
>
> liveContent
>     |e chart|
>     self session lastRequest isAjaxRequest ifTrue: [self
> waitForAnyChange].
>     e:=WebElement new.
>     e addText: self textToDisplay.
>     chart := WebChart new addData: {1@2. 2@3. 3@4. 4@5}.
>     e addBreak; addBreak.
>     e add: chart.
>     ^e
>
> Rob
>
> On Tue, Mar 3, 2009 at 5:07 PM, Rob Rothwell <[hidden email]>
> wrote:
>         Ok...so I found AidaCharts...very nice...but it will not
>         display if I do something like:
>        
>         liveContent
>             |e|
>             self session lastRequest isAjaxRequest ifTrue: [self
>         waitForAnyChange].
>             e:=WebElement new.
>             e addText: self textToDisplay.
>             e addBreak; addBreak.
>             e add: self liveChart.
>             ^e
>        
>         Where liveChart just produces a simple, static chart for now:
>        
>         liveChart
>             |e chart|
>             e := WebElement new.
>             chart := WebChart new addData: {1@2. 2@3. 3@4. 4@5}.
>             e add: chart.
>             ^e.
>        
>         I think I do not understand something about Ajax!
>        
>         Rob
>        
>        
>        
>         On Tue, Mar 3, 2009 at 4:33 PM, Rob Rothwell
>         <[hidden email]> wrote:
>                 On Tue, Mar 3, 2009 at 4:04 PM, Janko Mivšek
>                 <[hidden email]> wrote:
>                         Rob Rothwell pravi:
>                        
>                         > Thanks everyone for the help!
>                         > It seems to be working just fine...
>                        
>                        
>                         Already? Well, that's quick! So you have your
>                         project over the biggest
>                         obstacle now?
>                
>                 ;)
>                
>                
>                 Well...next I'll be asking nico questions about
>                 graphing!
>                
>                 We have some heavy-duty computing that we need to do
>                 as a separate process to predict capacity, staffing,
>                 etc..., and we want the display to update
>                 automatically.
>                
>                 For now we just wanted to do some simulations using
>                 historical data (say where every minute represents a
>                 day, or something like that...), but build the app to
>                 handle real time data.
>                
>                 So...histograms, anyone?  Point me in the right
>                 direction???  I know I saw some stuff nico had done a
>                 while back...
>                
>                 Thank you for the help!
>                
>                 Rob
>        
>        
>
> _______________________________________________
> Aida mailing list
> [hidden email]
> http://lists.aidaweb.si/mailman/listinfo/aida

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida

signature.asc (204 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Comet pattern explained on our website

Rob Rothwell
Yes...the charts work great without ajax; your WebChartDemo shows them all!

The first time I load the page (before_ajax_trackingboard.html), everything shows up.

Then, as soon as I send an announcment, the diplay updates.  Briefly, I see the text and not the chart, and then both disappear (after_ajax_trackingboard.html).

I can upload the project if you like, but I have have very simple methods with a static chart for now.  Of course, the idea would be that the data behind the chart would change, an announcement would be made, and viola...!

Thanks,

Rob

viewMain
    |e|
    e := WebElement new.
    e addTextH1: 'Tracking Board'.
    e add: (self liveContent updateEverySeconds: 1).
    self pageFrameWith: e title: 'Tracking Board'

liveContent
    |e|
    self session lastRequest isAjaxRequest ifTrue: [self waitForAnyChange].
    e:=WebElement new.
    e addText: self textToDisplay.
    e addBreak; addBreak.
    e add: self liveChart.
    ^e

liveChart
    |e chart|
    e := WebElement new.
    chart := WebChart new addData: {1@2. 2@3. 3@4. 4@5}.
    e add: chart.
    ^e

waitForAnyChange

     | count change |
     count := 1. change := false.

    Transcript show: 'Subscribing...'; cr.
    self textToDisplay: 'Periodic Content: ',Time now asString.
    self observee announcer
        subscribe: TrackingBoardAnnouncement
        do: [ :ann | change := true.
            self textToDisplay: (ann textToDisplay,': ',Time now asString) ].

     [change not and: [count < 3600]] whileTrue:
         [(Delay forSeconds: 1) wait.
         count := count + 1].

    Transcript show: 'Unsubscribing...';cr.
     self observee announcer unsubscribe: self

On Wed, Mar 4, 2009 at 11:41 AM, nico <[hidden email]> wrote:
Hi,

Do charts work without using ajax?

If so, can you email me the html source of your page with the chart not
diplayed?

Cheers!

Nico


Le mardi 03 mars 2009 à 17:12 -0500, Rob Rothwell a écrit :
> Sorry...or even:
>
> liveContent
>     |e chart|
>     self session lastRequest isAjaxRequest ifTrue: [self
> waitForAnyChange].
>     e:=WebElement new.
>     e addText: self textToDisplay.
>     chart := WebChart new addData: {1@2. 2@3. 3@4. 4@5}.
>     e addBreak; addBreak.
>     e add: chart.
>     ^e
>
> Rob
>
> On Tue, Mar 3, 2009 at 5:07 PM, Rob Rothwell <[hidden email]>
> wrote:
>         Ok...so I found AidaCharts...very nice...but it will not
>         display if I do something like:
>
>         liveContent
>             |e|
>             self session lastRequest isAjaxRequest ifTrue: [self
>         waitForAnyChange].
>             e:=WebElement new.
>             e addText: self textToDisplay.
>             e addBreak; addBreak.
>             e add: self liveChart.
>             ^e
>
>         Where liveChart just produces a simple, static chart for now:
>
>         liveChart
>             |e chart|
>             e := WebElement new.
>             chart := WebChart new addData: {1@2. 2@3. 3@4. 4@5}.
>             e add: chart.
>             ^e.
>
>         I think I do not understand something about Ajax!
>
>         Rob
>
>
>
>         On Tue, Mar 3, 2009 at 4:33 PM, Rob Rothwell
>         <[hidden email]> wrote:
>                 On Tue, Mar 3, 2009 at 4:04 PM, Janko Mivšek
>                 <[hidden email]> wrote:
>                         Rob Rothwell pravi:
>
>                         > Thanks everyone for the help!
>                         > It seems to be working just fine...
>
>
>                         Already? Well, that's quick! So you have your
>                         project over the biggest
>                         obstacle now?
>
>                 ;)
>
>
>                 Well...next I'll be asking nico questions about
>                 graphing!
>
>                 We have some heavy-duty computing that we need to do
>                 as a separate process to predict capacity, staffing,
>                 etc..., and we want the display to update
>                 automatically.
>
>                 For now we just wanted to do some simulations using
>                 historical data (say where every minute represents a
>                 day, or something like that...), but build the app to
>                 handle real time data.
>
>                 So...histograms, anyone?  Point me in the right
>                 direction???  I know I saw some stuff nico had done a
>                 while back...
>
>                 Thank you for the help!
>
>                 Rob
>
>
>
> _______________________________________________
> Aida mailing list
> [hidden email]
> http://lists.aidaweb.si/mailman/listinfo/aida

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida



_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida

before_ajax_trackingboard.html (5K) Download Attachment
after_ajax_trackingboard.html (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Comet pattern explained on our website

Rob Rothwell
I don't know Nico!  These look identical to me...must be something else going on?

Take care,

Rob

On Wed, Mar 4, 2009 at 11:55 AM, Rob Rothwell <[hidden email]> wrote:
Yes...the charts work great without ajax; your WebChartDemo shows them all!

The first time I load the page (before_ajax_trackingboard.html), everything shows up.

Then, as soon as I send an announcment, the diplay updates.  Briefly, I see the text and not the chart, and then both disappear (after_ajax_trackingboard.html).

I can upload the project if you like, but I have have very simple methods with a static chart for now.  Of course, the idea would be that the data behind the chart would change, an announcement would be made, and viola...!

Thanks,

Rob

viewMain
    |e|
    e := WebElement new.
    e addTextH1: 'Tracking Board'.
    e add: (self liveContent updateEverySeconds: 1).
    self pageFrameWith: e title: 'Tracking Board'


liveContent
    |e|
    self session lastRequest isAjaxRequest ifTrue: [self waitForAnyChange].
    e:=WebElement new.
    e addText: self textToDisplay.
    e addBreak; addBreak.
    e add: self liveChart.
    ^e

liveChart
    |e chart|
    e := WebElement new.
    chart := WebChart new addData: {1@2. 2@3. 3@4. 4@5}.
    e add: chart.
    ^e

waitForAnyChange

     | count change |
     count := 1. change := false.

    Transcript show: 'Subscribing...'; cr.
    self textToDisplay: 'Periodic Content: ',Time now asString.
    self observee announcer
        subscribe: TrackingBoardAnnouncement
        do: [ :ann | change := true.
            self textToDisplay: (ann textToDisplay,': ',Time now asString) ].

     [change not and: [count < 3600]] whileTrue:
         [(Delay forSeconds: 1) wait.
         count := count + 1].

    Transcript show: 'Unsubscribing...';cr.
     self observee announcer unsubscribe: self


On Wed, Mar 4, 2009 at 11:41 AM, nico <[hidden email]> wrote:
Hi,

Do charts work without using ajax?

If so, can you email me the html source of your page with the chart not
diplayed?

Cheers!

Nico


Le mardi 03 mars 2009 à 17:12 -0500, Rob Rothwell a écrit :
> Sorry...or even:
>
> liveContent
>     |e chart|
>     self session lastRequest isAjaxRequest ifTrue: [self
> waitForAnyChange].
>     e:=WebElement new.
>     e addText: self textToDisplay.
>     chart := WebChart new addData: {1@2. 2@3. 3@4. 4@5}.
>     e addBreak; addBreak.
>     e add: chart.
>     ^e
>
> Rob
>
> On Tue, Mar 3, 2009 at 5:07 PM, Rob Rothwell <[hidden email]>
> wrote:
>         Ok...so I found AidaCharts...very nice...but it will not
>         display if I do something like:
>
>         liveContent
>             |e|
>             self session lastRequest isAjaxRequest ifTrue: [self
>         waitForAnyChange].
>             e:=WebElement new.
>             e addText: self textToDisplay.
>             e addBreak; addBreak.
>             e add: self liveChart.
>             ^e
>
>         Where liveChart just produces a simple, static chart for now:
>
>         liveChart
>             |e chart|
>             e := WebElement new.
>             chart := WebChart new addData: {1@2. 2@3. 3@4. 4@5}.
>             e add: chart.
>             ^e.
>
>         I think I do not understand something about Ajax!
>
>         Rob
>
>
>
>         On Tue, Mar 3, 2009 at 4:33 PM, Rob Rothwell
>         <[hidden email]> wrote:
>                 On Tue, Mar 3, 2009 at 4:04 PM, Janko Mivšek
>                 <[hidden email]> wrote:
>                         Rob Rothwell pravi:
>
>                         > Thanks everyone for the help!
>                         > It seems to be working just fine...
>
>
>                         Already? Well, that's quick! So you have your
>                         project over the biggest
>                         obstacle now?
>
>                 ;)
>
>
>                 Well...next I'll be asking nico questions about
>                 graphing!
>
>                 We have some heavy-duty computing that we need to do
>                 as a separate process to predict capacity, staffing,
>                 etc..., and we want the display to update
>                 automatically.
>
>                 For now we just wanted to do some simulations using
>                 historical data (say where every minute represents a
>                 day, or something like that...), but build the app to
>                 handle real time data.
>
>                 So...histograms, anyone?  Point me in the right
>                 direction???  I know I saw some stuff nico had done a
>                 while back...
>
>                 Thank you for the help!
>
>                 Rob
>
>
>
> _______________________________________________
> Aida mailing list
> [hidden email]
> http://lists.aidaweb.si/mailman/listinfo/aida

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida




_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida