[Seaside] Re: Re: [Mewa] Can't format multipleRelationshipAttribute
Germán S. Arduino
gsa at softhome.net
Sun Apr 25 14:24:30 CEST 2004
Hi Adrian:
Exactly that I was trying and works ok.
I was writing a mail to say that when your mail is arriving.
Thanks Again Adrian.
"Adrian Lienhard" <adi at netstyle.ch> escribió en el mensaje
news:005a01c42abd$0fd9e420$0201a8c0 at adrianpc...
> 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