[Seaside] Seaside + Comet

Esteban Robles Luna esteban.roblesluna at gmail.com
Fri Jan 19 20:49:15 UTC 2007


Hi list,
I`m a newbie with seaside and comet. After loading successfully
SeasideComent on VW, I looked at the examples of Comet.
In the counter example we can see these code:

	pusher javascript: (SUElement new
		id: 'count';
		update: self count contents asString)

The update method receives a string to be updated in the page. I`m
trying to reproduce the renderOn: behaviour of a SUComponent so that
the string to be pushed is a result of the rendering process.
The best solution that I have is a modification of CTChat>>push:
aBlock. This is the code:

		contextHandle := self pusher handlers first context.
		document := (Seaside.WAHtmlStreamDocument new)
							bodyStream;
							yourself.
	context := WARenderingContext new document: document; actionUrl:
contextHandle actionUrl.
	aWebView renderWithContext: context.
	htmlFragment := document stream contents.	

		pusher
			javascript: (Seaside.SUElement new
									id: aWebView id;
									update: htmlFragment).

It works fine for rendering, but aWebView ( subclass of SUComponent )
renders itself using an Updater like this:


| fid mid |

		fid := aRenderer nextId.
		mid := aRenderer nextId.
		aRenderer form
            	id: fid;
	            with: [ 	aRenderer checkbox
			            	value: self model model value;
			            	callback: [ :value |  self model model value: value ];
						onClick: (aRenderer updater
							               id: mid;
							               triggerForm: fid;
							               callback: [ :r |  ]).
					aRenderer label with: self model label text].


The problem is that the updater is not working after the re-rendering.
I supposed that the problem is with the push-like code. Is there a
solution for using comet and the renderOn: transparently?
Regards
Esteban


More information about the Seaside mailing list