[squeak-dev] Magritte Validation Question

Udo Schneider Udo.Schneider at homeaddress.de
Thu Nov 5 13:50:27 UTC 2009


Hi,

I have a question regarding Magritte Validation. Given the following 
description

descriptionAcquireRetryDelay
	^ MANumberDescription new
		selectorAccessor: #acquireRetryDelay
		label: 'Aquire Retry Delay';
		group: 'C3P0';
		priority: 100;
		beRequired;
		beInteger;
		bePositive;
		yourself

I do have a problem if the user enters a non-number. This is IMHO caused 
by #bePositive which checks if a given number is positive by sending 
#positive.

However if the user enters "aaa" the object being validated is the 
String ... which does not understand #positive.

If I remove the #bePositive condition everything is find and I do get 
(expected) Validation Errors complaining about invalid input and 
non-integer.

So I'm wondering if I need to somehow specify to check the #bePositive 
condition (or any other condition for this case) only /after/ the 
correct type has been validated/determined.

Any pointers?

CU,

Udo




More information about the Squeak-dev mailing list