<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000099">
<font size="-1"><font face="Verdana">Hallo,<br>
<br>
I'm developing a web application in that i need to update an image
element very often but neither periodically nor on user input. The
image gets computed on the server as a Form-object. I'm trying to
realize this with Comet:<br>
<br>
TestApp>>renderContentOn: html<br>
html span<br>
id: #display;<br>
with: [ html image form: (self getDisplayForm) ].<br>
html submitButton<br>
onClick: (html request callback: [ self update ]);<br>
with: 'update'.<br>
html script: (html comet<br>
pusher: self pusher;<br>
connect)<br>
<br>
TestApp>>update<br>
self pusher javascript: [ :script |<br>
script element<br>
id: #display;<br>
update: [ :html | html image form: </font></font><font
size="-1"><font face="Verdana">(self getDisplayForm)</font></font><font
size="-1"><font face="Verdana"> ] ].<br>
<br>
The method 'getDisplayForm' computes a new Form-object on the fly.<br>
<br>
When I click the Button 'update' it works as expected (the form gets
computed and the image on my website updates immediately). But when I
perform the 'update' method from outside this class (every time when a
new image is available that is computed somewhere else), I get this
error:<br>
<br>
UndefinedObject>>doesNotUnderstand: #application<br>
WARenderingContext>>registry<br>
^ WACurrentSession value application<br>
WARenderingContext>>urlForDocument:mimeType:fileName:<br>
...<br>
<br>
Afaik the problem is the missing WACurrentSession and because of that
it's not possible to compute a temporary URL for the image.<br>
<br>
But I don't understand, why one time my 'update' method works (after
the button click) and one time not (when I perform the 'update' method
directly).<br>
<br>
Can anybody explain this strange behavior? Or does someone have another
idea how I can update an image with server push (without user input or
site reload)? I would be very very happy to get some new ideas! - It's
an important part of my master thesis.. <br>
<br>
Jochen<br>
<br>
<br>
</font></font>
</body>
</html>