[Seaside] Re: Comet and #call:

TimM tamackinnon at gmail.com
Fri Aug 6 13:28:22 UTC 2010

I've been following this thread with some interest - as I've kind of been doing
something similar (although I didn't realise that I was).

Julian - I don't really understand your example - I had written something
different and I'm wondering why it seems so different.

I had:

renderContentOn: html
	(html div)
		id: 'owner';
		with: [ 
			html render: self holderView.
			(html button)
			    onClick: (html jQuery ajax script: [ :s | self releaseToken ]);			
		            with: 'Honk It' ].

	self tokenModel releaseToken.
	self pusher
		javascript: [ :jsScript | 
			jsScript << ((jsScript jQuery id: 'noise') each: (JSStream this call: 'play'))
				, (self waitersView ajaxReplace: jsScript jQuery) , (self holderView
ajaxReplace: jsScript jQuery) ]

Then I have components that implement #ajaxReplace

ajaxReplace: jQuery

	^(jQuery id: myId) replaceWith: [:r | r render: self].

(Note: myId is an instance variable where I cache an "html nextId" as I figured
the components should know their own id's. Haven't quite got that bit clean yet
- I was trying to make it order independent, but I haven't always got the html
object where I need it? I'm wondering if these components should just keep their
own counter?).

This seems much different from what Julian did:
     contentType: WAMimeType textHtml;
     nextPutAll: (aComponent rendererClass builder render: aComponent) ]

So I'm wondering what the merit of the different approaches is?


More information about the seaside mailing list