[Seaside] a problem with a javascript statement

Johan Brichau johan at inceptive.be
Fri Apr 8 15:30:21 UTC 2011

On 08 Apr 2011, at 17:21, Esteban Lorenzano wrote:

> I also prefer to put the javascript into separated files, but in this case it is a dynamic generated one, with a lot of possible statements (I was just simplifying the example... that's why I cannot use also then:else: :P)

okay ;-)

Just make a subclass JSFullIfThenElse of JSIfThenElse with the following method override:

javascriptContentOn: aStream
	aStream nextPutAll: 'if('.
	self owner javascriptContentOn: aStream.
	aStream nextPutAll: '){'.
	aStream javascript: self trueStatement.
	aStream nextPutAll: '} else {'.
	aStream javascript: self falseStatement.
	aStream nextPutAll: '}'.

More information about the seaside mailing list