MAOneToManyComponent>>value not getting set

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

MAOneToManyComponent>>value not getting set

cnantais
When trying to add a new item inside an MAToManyRelationDescription
container, I get the error found in the attached file.  It says that
the MAOneToManyComponent>>value is an undefined object.

I reproduced this error in the MADescriptionEditor example as well as
in my code.

I'm using the latest Magritte-all package.

Chad


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki

examplebrowser.html (88K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: MAOneToManyComponent>>value not getting set

Lukas Renggli-2
> When trying to add a new item inside an MAToManyRelationDescription
> container, I get the error found in the attached file.  It says that
> the MAOneToManyComponent>>value is an undefined object.
>
> I reproduced this error in the MADescriptionEditor example as well as
> in my code.
>
> I'm using the latest Magritte-all package.

I cannot reproduce. Are you sure to have initialized the collection  
or set the default value to be #()?

Cheers,
Lukas

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



_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: MAOneToManyComponent>>value not getting set

cnantais
Hey Lukas,

It's actually the MAOneToManyComponent>>value that is nil, and not the model.
This error occurs during the answer back from the model editor to the
collection report.  It has something to do with the
MAOneToManyComponent's memento having a nil value for #cache.

Any help is appreciated, as always.

Cheers,

Chad

On 4/29/07, Lukas Renggli <[hidden email]> wrote:

> > When trying to add a new item inside an MAToManyRelationDescription
> > container, I get the error found in the attached file.  It says that
> > the MAOneToManyComponent>>value is an undefined object.
> >
> > I reproduced this error in the MADescriptionEditor example as well as
> > in my code.
> >
> > I'm using the latest Magritte-all package.
>
> I cannot reproduce. Are you sure to have initialized the collection
> or set the default value to be #()?
>
> Cheers,
> Lukas
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
>
>
>
> _______________________________________________
> SmallWiki, Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>


--
Chad Nantais

Buy my album Zero Ground on iTunes:
http://tinyurl.com/2sojcn

View my artist profile on MySpace Music:
http://myspace.com/chadnantais

Hear my music on-demand on Last.fm:
http://www.last.fm/music/Chad+Nantais

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: MAOneToManyComponent>>value not getting set

Lukas Renggli-2
> It's actually the MAOneToManyComponent>>value that is nil, and not  
> the model.
> This error occurs during the answer back from the model editor to the
> collection report.  It has something to do with the
> MAOneToManyComponent's memento having a nil value for #cache.

And in your object the value is actually a collection? Usually the  
cache just reads the value from your object.

I am confused. How can I reproduce?

Cheers,
Lukas

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



_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: MAOneToManyComponent>>value not getting set

cnantais
Lukas,

Sorry to be confusing.  But here's more of an explanation.

I have a class ImageFolderDescription, which is a subclass of
MAToManyRelationDescription.  This description is added to my
PlantModel through a DescriptionEditor.

So, when someone goes to the edit form for PlantModel, the form
contains an MAOneToManyComponent for the Plant's
ImageFolderDescription.  When they click the add button to create a
new image in the ImageFolder, it shows them the editor component for
the image--no problem.  But once they are done editing the image and
click the Save button, they get the "UndefinedObject>>copyWith:"
error.

In fact it doesn't matter which class I add to the ImageFolder,
whether its an image or and Object or a credit card, it still throws
this error.

Chad

On 5/10/07, Lukas Renggli <[hidden email]> wrote:

> > It's actually the MAOneToManyComponent>>value that is nil, and not
> > the model.
> > This error occurs during the answer back from the model editor to the
> > collection report.  It has something to do with the
> > MAOneToManyComponent's memento having a nil value for #cache.
>
> And in your object the value is actually a collection? Usually the
> cache just reads the value from your object.
>
> I am confused. How can I reproduce?
>
> Cheers,
> Lukas
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
>
>
>
> _______________________________________________
> SmallWiki, Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>


--
Chad Nantais

Buy my album Zero Ground on iTunes:
http://tinyurl.com/2sojcn

View my artist profile on MySpace Music:
http://myspace.com/chadnantais

Hear my music on-demand on Last.fm:
http://www.last.fm/music/Chad+Nantais

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: MAOneToManyComponent>>value not getting set

Lukas Renggli-2
> I have a class ImageFolderDescription, which is a subclass of
> MAToManyRelationDescription.  This description is added to my
> PlantModel through a DescriptionEditor.

It is a bit hard to see what happens. I attached a file that tries to  
implement what you like to have: PlantModel with a collection of  
files. The attached code works for me.



Cheers,
Lukas

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




_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki

PlantImages.st (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: MAOneToManyComponent>>value not getting set

cnantais
Lukas,

My Plant model is a subclass of MAAdaptiveModel and the #images
description is an MAOneToManyDescription created through a description
editor.  Therefore, your solution above does not work for me.

On 5/10/07, Lukas Renggli <[hidden email]> wrote:

> > I have a class ImageFolderDescription, which is a subclass of
> > MAToManyRelationDescription.  This description is added to my
> > PlantModel through a DescriptionEditor.
>
> It is a bit hard to see what happens. I attached a file that tries to
> implement what you like to have: PlantModel with a collection of
> files. The attached code works for me.
>
>
>
> Cheers,
> Lukas
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
>
>
>
>
> _______________________________________________
> SmallWiki, Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>
>


--
Chad Nantais

Buy my album Zero Ground on iTunes:
http://tinyurl.com/2sojcn

View my artist profile on MySpace Music:
http://myspace.com/chadnantais

Hear my music on-demand on Last.fm:
http://www.last.fm/music/Chad+Nantais

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki