Login  Register

[Magritte] Validation object existence in collection.

Posted by Humber Aquino on Nov 28, 2006; 1:13am
URL: https://forum.world.st/Magritte-Validation-object-existence-in-collection-tp89702.html

Hi Seasiders :P  I have a Magritte question. It´s about validating and
managing a collection of described objects.
For example:
I have a Person class with 2 descriptions:
Person class>>descriptionName
 ^ (MAStringDescription auto: 'name' label: 'Name' priority: 10)
           beRequired;
           yourself.
and
Person class>>descriptionAge.
 ^ MANumberDescription auto: 'name' label: 'Name' priority: 10.

When i want a seaside component for editing or creating a Person Object i call
person := self call:(Person new asComponent addValidatedForm; yourself).

Thats pretty standard. he Thing is, all the validations for each
description in this container are validated but only for this object.
Do i have to make my own validations if i want to validate the
existence of this object in a Collection. I know this sound really
dumb but i would like to know if theres a clean way to do this. I want
to use Seaside with Magritte for building and validating my objects
and persist them with magma.
I created a magma repository with a Dictionary as a root. This
dictionary has one entry called people with a OrderedCollection as
it's value.
So, which strategy is the best in this case? Is there a clean way to
do it? Am i missing something? Sorry for the verbosity and thanks
again!

One last thing. In the MAReport class is a method called NOW that says
we shouldn't use that class. I works that bad? I Used it and still now
it's working ok.

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside