[Seaside] Re: [Mewa] Can't format multipleRelationshipAttribute
Adrian Lienhard
adi at netstyle.ch
Sun Apr 25 14:01:36 CEST 2004
Hi German
If the block taken by #addValidationRule: evaluates to true, the attribute
is assumed to be valid. So, you just have to make it the other way round...
If you want to assure that at least one item is selected use something like:
...addValidationRule: [:collection | collection isEmpty not]
Adrian
> By example, in the same multiple relationship I want to check that at
> least one interest is checked, as follow:
>
> relationshipTo: [MySession currentSession domainmodel interests]
> formatWith: [:each | each interestName, ' (' , each interestType
> , ')'];
>
> addValidationRule: [:collection | collection size < 1]
> errorString: 'Select at least one interest' translated].
>
> Thanks by your time.
>
> gsa.
>
>
>
>
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/listinfo/seaside
_____________________
Adrian Lienhard
www.adrian-lienhard.ch
www.netstyle.ch
More information about the Seaside
mailing list