Steven W. Riggins
2006-08-18 01:33:17 UTC
I have a input field and when I change the value of the tweak field,
its mirrored into the field. I also use this field as a input field,
so I want to know when the value changed, and update my model.
Problem is, I set the field, I get a changed event, I convert the
field string gto a number, set my model, which updates the field, and
around and around I go.
propertyValueAt: key put: newValue with: changeEvent
"Store the value of my property at key"
| oldValue |
myProperties ifNil:[myProperties := IdentityDictionary new].
oldValue := myProperties atProperty: key put: newValue.
oldValue == newValue ifTrue:[^newValue].
self signalChanged: changeEvent from: oldValue to: newValue.
^newValue
Does ==, which fails because '123' == (123 asString) fails.
WHats the proper pattern for this use of tweak fields and input fields?
its mirrored into the field. I also use this field as a input field,
so I want to know when the value changed, and update my model.
Problem is, I set the field, I get a changed event, I convert the
field string gto a number, set my model, which updates the field, and
around and around I go.
propertyValueAt: key put: newValue with: changeEvent
"Store the value of my property at key"
| oldValue |
myProperties ifNil:[myProperties := IdentityDictionary new].
oldValue := myProperties atProperty: key put: newValue.
oldValue == newValue ifTrue:[^newValue].
self signalChanged: changeEvent from: oldValue to: newValue.
^newValue
Does ==, which fails because '123' == (123 asString) fails.
WHats the proper pattern for this use of tweak fields and input fields?