[Seaside] Lazy callbacks

Hernán Galante galanteh at smalltalking.net
Sat Sep 6 17:38:59 CEST 2003


Hi all!
	I'm making an application which tracks all the messages that are
sent to the model and they are stored in a collection. So I can know all
the messages that were sent to a particular object at a time and by
whom. So this kind of track made a good security policy ;-)
But (always there's a problem :() I found that seaside evaluates all the
callbacks causing a sent of messages that are innecesary. So I enhanced
the inteligence of the callback of a text input wrapping the
callbackBlock with another block which check whether the value was
changed or not. 
What do you think of this? Can we extent this to all the callbacks?

textInputWithValue: anObject callback: callbackBlock
	" Append an input text to the receiver."

	| callback |
	callback := [ :value | value = anObject ifFalse: [ callbackBlock
value: value ]].
	self
		valueInputOfType: 'text'
		value: anObject
		callback: callback

Best regards, 
Hernán.-



More information about the Seaside mailing list