Stopping SeasideAsync refreshes?

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

Stopping SeasideAsync refreshes?

Ragnar Hojland Espinosa-2
I'm trying to process a file and display some messages as it is
processed. The skeleton I have below works fine.

My issue is how to stop the refreshes once the processing is done (for
example, once messages has the string 'Done'). I tried moving the
processing and messages onto an embedded subcomponent, calling it and
answering from it when it was done, but the page kept refreshing.

What should I be doing?



initialize
  messages _ Dictionary new.
  messages at: #text put: 'Stopped'.



renderContentOn: html
  html form multipart; with: [
  html fileUpload callback: [:f |
     [self insertFile: f ] forkNamed: 'insertProcess'.
     html div id: 'insertMessages';
        refreshWith: [ :ev :h | h render: (messages at: #text) ]
        every: 2 seconds ].

     html submitButton text: 'Insert File'.

     html div id: 'insertMessages';
        with: [ html render: (messages at:  #text) ]
  ]



insertFile: aFile
  (1 to: 5) do: [ :i |
     messages at: #text put: ('Line ', i asString).
     (Delay forSeconds: 1) wait ].

  messages at: #text put: 'Done'



rendererClass
  ^ WAAsyncRenderCanvas


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside