From: sop2@hotmail.fr
To: smallwiki@iam.unibe.ch
Subject: RE: Magritte question
Date: Sat, 8 Sep 2007 15:31:57 +0200



> From: renggli@iam.unibe.ch
> Subject: Re: Magritte question
> Date: Sat, 8 Sep 2007 11:42:15 +0200
> To: smallwiki@iam.unibe.ch
>
> > Likely that you're using the same component for the entire length
> > of the
> > session. You may want to copy the description as well, I don't
> > recall if
> > Magritte still caches its descriptions, so say anItem description copy
> > addCondtion.
>
> Yes, you have to copy the description, else your globally cached
> description ends up with a whole set of conditions.
>
> Caching can be disabled by using a different description-builder,
> however need the descriptions a lot (e.g. searching, persistency) it
> is really worth to let Magritte only build them once and then cache
> them.
>
Thank you for your help.

Now I have another problem :

buildEditorFor: anItem
    ^(anItem description copy
            addCondition: [:memento | (Item repository
                contains: [:each | memento model id = each not]) not]
            labelled: 'An item with that id already exists';
            asComponentOn: anItem)
        addValidatedForm;
        yourself

Of course it was : contains: [:each | memento model id = each id]) not]

The memento model id doesn't change it's value when I edit it. I saw MACheckedMemento has a #cache and a #original method, maybe I should use them, but I don't know how.

Sebastien

> Lukas
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
>
>
> _______________________________________________
> SmallWiki, Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki


Besoin d'un e-mail ? Créez gratuitement un compte Windows Live Hotmail et bénéficiez de 2 Go de stockage ! Windows Live Hotmail


Besoin d'un e-mail ? Créez gratuitement un compte Windows Live Hotmail et bénéficiez de 2 Go de stockage ! Windows Live Hotmail