[squeak-dev] Magritte: Validation deprecated?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Magritte: Validation deprecated?

Udo Schneider
All,

I'm currently playing a bit with Magritte and I can !"§"&%! myself for
not take a look at it earlier.

One thing I'm not sure about at the moment is validation. It seems that
validation code is not called when saving values.

I'm having a description like this:
descriptionEmail
        ^ MAStringDescription new autoAccessor: 'name';
        group: 'Internet';
                 beEditable;
                 beSearchable;
               
                addCondition: [:value | self halt. (value includes: $@)
                                and: [(value subStrings: $@) size = 2]]
                labelled: 'Invalid E-Mail';
                 comment: 'Please enter the name of the object';
                 default: 'Unnamed';
                 label: 'E-Mail'

If I call the model using "model asMorph  addButtons; addWindow ;
callInWorld" and save a bogus E-Mail the breakpoint is not reached.

Are Conditions still supported?

CU,

Udo


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Magritte: Validation deprecated?

Lukas Renggli
> Are Conditions still supported?

Sure. Your code works well for me with Seaside and Morphic. I get a
debugger for both front ends.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch

Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Magritte: Validation deprecated?

Philippe Marschall
In reply to this post by Udo Schneider
BTW there is the in NetworkAddress package in Magritte Add-Ons [1]
which provides an NAEmailDescription.

 [1] http://source.lukas-renggli.ch/magritteaddons.html

Cheers
Philippe

2008/12/4, Udo Schneider <[hidden email]>:

> All,
>
> I'm currently playing a bit with Magritte and I can !"§"&%! myself for
> not take a look at it earlier.
>
> One thing I'm not sure about at the moment is validation. It seems that
> validation code is not called when saving values.
>
> I'm having a description like this:
> descriptionEmail
> ^ MAStringDescription new autoAccessor: 'name';
> group: 'Internet';
> beEditable;
> beSearchable;
>
> addCondition: [:value | self halt. (value includes: $@)
> and: [(value subStrings: $@) size = 2]]
> labelled: 'Invalid E-Mail';
> comment: 'Please enter the name of the object';
> default: 'Unnamed';
> label: 'E-Mail'
>
> If I call the model using "model asMorph  addButtons; addWindow ;
> callInWorld" and save a bogus E-Mail the breakpoint is not reached.
>
> Are Conditions still supported?
>
> CU,
>
> Udo
>
>
>


Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: Magritte: Validation deprecated?

Udo Schneider
In reply to this post by Lukas Renggli
Lukas Renggli schrieb:
> Sure. Your code works well for me with Seaside and Morphic. I get a
> debugger for both front ends.
Thanks for the confirmation. I tried the code in a fresh image and it
works. Still not sure how I corrupted my work image though ...

Thanks for your help.

CU,

Udo


Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: Magritte: Validation deprecated?

Udo Schneider
In reply to this post by Philippe Marschall
Philippe Marschall schrieb:
> BTW there is the in NetworkAddress package in Magritte Add-Ons [1]
> which provides an NAEmailDescription.
Will take a look at it. Thanks for the pointer.

CU,

Udo