[Seaside] Preserving the CSS style between component and task

Hernán Morales Durand hernan.morales at gmail.com
Mon May 10 15:23:50 UTC 2010


Hi all,

I'm using Seaside 3.0 and trying to use tasks for a very simple
converter application. I've followed the tutorial in the Seaside book
so I can change it later to my needs

====== Supporting sample code in  aSubclassOfWAComponent =======

>>renderContentOn: html
			html submitButton
				callback: [ self callTask ];
				with: 'Call' ] ].

>>initialize
	super initialize.
	tasks := OrderedCollection new.
	selection := WAValueHolder new.
	tasks add: SubclassOfWATask new

>>children
	^ tasks

>>updateRoot: anHtmlRoot
        super updateRoot: anHtmlRoot.
        anHtmlRoot
		stylesheet url: ( MyFileLibrary / #styleCss );
		title: self title.

====== Supporting sample code in  aSubclassOfWATask =======

>>go
	[ self chooseInput ] whileFalse.
	[ self chooseOutput ] whileFalse.

>>chooseOutput
	selectedOption :=
		self chooseFrom: self availableOutputFormats
			caption: 'Choose output format' translated.
	^ selectedOption isNil not

=====================================================

The problem is when the component calls the task, the style is lost. I
would like to share the style defined in my #updateRoot:, what's the
best way of doing this? Any hints?

Cheers,

Hernán


More information about the seaside mailing list