[Magritte] Complex Models

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

[Magritte] Complex Models

Sean P. DeNigris
Administrator
Has anyone successfully used Magritte on a complex model (e.g. aBook has anAuthor has nameString and birthDate) displayed with Morphic? I found numerous threads, but nothing conclusive, and mostly related to Seaside. This seems so fundamental to modeling I was surprised not to find any info.

As a start, how does one specify a custom widget for a description?

Thanks.
Sean

http://forum.world.st/describing-a-complex-data-types-with-Magritte-td117690.html#a117695
http://forum.world.st/validation-of-referenced-objects-td116286.html#a116288
http://forum.world.st/expanded-view-of-MAToOneRelationDescription-td95690.html
http://forum.world.st/MAReport-status-td116298.html#a116299
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: [Magritte] Complex Models

Sean P. DeNigris
Administrator
Exploring around, I found that MAToOneRelationDescription inherits class>>#defaultMorphClasses from MAElementDescription, which returns an MATextMorph, so I thought about subclassing my own description or setting the default morph class property, but it seems that by the time the description is looking for a morph class, it may be too late, no? What I really want is to recursively embed the full editor for the related Author class in the form for the Book, but I'm not sure exactly where to hook in. #acceptMagritte: seemed like an obvious place, but everything seems already figured out by the time it's called - although maybe that's due to caching? Can caching be turned off to more easily see what's going on?

Lukas, in one of the posts, you mentioned that you had some ideas on how to fix this. I'd like to have a conversation about that.

Also, for the time being, I'd just like to know where I should hook in to manually display an editor for the author object. I also want to add auto-complete to some fields...

Thanks.
Sean
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: [Magritte] Complex Models

John McKeon
Hi Sean,
Send morphClass: to a description to make it use a custom MAMorph subclass. 
In the Seaside world you would send componentClass: to the description. For the 1-1 relation descriptions there are MAInternalEditorComponent and MAExternalEditorComponent (the defaults) but there are no equivalents in Magritte-Morphic. 

Hope that helps

On Tue, Jan 3, 2012 at 8:55 PM, Sean P. DeNigris <[hidden email]> wrote:
Exploring around, I found that MAToOneRelationDescription inherits
class>>#defaultMorphClasses from MAElementDescription, which returns an
MATextMorph, so I thought about subclassing my own description or setting
the default morph class property, but it seems that by the time the
description is looking for a morph class, it may be too late, no? What I
really want is to recursively embed the full editor for the related Author
class in the form for the Book, but I'm not sure exactly where to hook in.
#acceptMagritte: seemed like an obvious place, but everything seems already
figured out by the time it's called - although maybe that's due to caching?
Can caching be turned off to more easily see what's going on?

Lukas, in one of the posts, you mentioned that you had some ideas on how to
fix this. I'd like to have a conversation about that.

Also, for the time being, I'd just like to know where I should hook in to
manually display an editor for the author object. I also want to add
auto-complete to some fields...

Thanks.
Sean

--
View this message in context: http://forum.world.st/Magritte-Complex-Models-tp4259124p4259524.html
Sent from the Magritte, Pier and Related Tools mailing list archive at Nabble.com.
_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki


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

Re: [Magritte] Complex Models

Lukas Renggli
In reply to this post by Sean P. DeNigris
As John writes, create custom Morph classes and set them using
#morphClass:. MATextMorph is a nice default if there is nothing
better, because all descriptions have a way to convert their model to
a string. Compared to Magritte-Seaside there are a lot of views in
Magritte-Morph missing, simply because Magritte-Morph never saw the
use of Magritte-Seaside.

Lukas

On 4 January 2012 02:55, Sean P. DeNigris <[hidden email]> wrote:

> Exploring around, I found that MAToOneRelationDescription inherits
> class>>#defaultMorphClasses from MAElementDescription, which returns an
> MATextMorph, so I thought about subclassing my own description or setting
> the default morph class property, but it seems that by the time the
> description is looking for a morph class, it may be too late, no? What I
> really want is to recursively embed the full editor for the related Author
> class in the form for the Book, but I'm not sure exactly where to hook in.
> #acceptMagritte: seemed like an obvious place, but everything seems already
> figured out by the time it's called - although maybe that's due to caching?
> Can caching be turned off to more easily see what's going on?
>
> Lukas, in one of the posts, you mentioned that you had some ideas on how to
> fix this. I'd like to have a conversation about that.
>
> Also, for the time being, I'd just like to know where I should hook in to
> manually display an editor for the author object. I also want to add
> auto-complete to some fields...
>
> Thanks.
> Sean
>
> --
> View this message in context: http://forum.world.st/Magritte-Complex-Models-tp4259124p4259524.html
> Sent from the Magritte, Pier and Related Tools mailing list archive at Nabble.com.
> _______________________________________________
> Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki



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

Re: [Magritte] Complex Models

Sean P. DeNigris
Administrator
In reply to this post by John McKeon
John McKeon wrote
For the 1-1 relation descriptions there are MAInternalEditorComponent and
MAExternalEditorComponent (the defaults) but there are no equivalents in
Magritte-Morphic.
I came across this old post. These are implemented now for Morphic :)
Cheers,
Sean