1 Sep 2009 15:09
addCondition:labelled:
Joel Turnbull <joel <at> ardishealth.com>
2009-09-01 13:09:47 GMT
2009-09-01 13:09:47 GMT
addCondition:labelled does not seem to be working the way I expected.
I just want to validate that a given text field is not empty
I have a description definition method and setter:
descriptionTags
^MAStringDescription new
selectorAccessor: #tagsConverter;
label: 'Tags';
priority: 40;
addCondition: [:value | value notEmpty ]
labelled: 'Please provide at least one tag';
yourself
tagsConverter: aString
tags := aString asUppercase subStrings asSet
On submit, I get an error that nil does not understand asUppercase. Shouldn't the condition fail before the setter is called? I've tried [ :value | value notNil ], and beRequired as well, got the same error. I also tried to change the initialize method of the object I'm describing to set tags to an empty collection but that didn't work either.
Thanks,
Joel
I just want to validate that a given text field is not empty
I have a description definition method and setter:
descriptionTags
^MAStringDescription new
selectorAccessor: #tagsConverter;
label: 'Tags';
priority: 40;
addCondition: [:value | value notEmpty ]
labelled: 'Please provide at least one tag';
yourself
tagsConverter: aString
tags := aString asUppercase subStrings asSet
On submit, I get an error that nil does not understand asUppercase. Shouldn't the condition fail before the setter is called? I've tried [ :value | value notNil ], and beRequired as well, got the same error. I also tried to change the initialize method of the object I'm describing to set tags to an empty collection but that didn't work either.
Thanks,
Joel
_______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki
RSS Feed