MAToOneRelationDescription display

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

MAToOneRelationDescription display

HilaireFernandes
Hello,

I am looking at how description MAToOneRelationDescription could be
rendered differently in its snapshot view (don't know how to name it).

As far I see it, only the model attribute description with the highest
priority is displayed.
So far I fail to see how to change it. Tried #display: without
success... and #reference: I dont' understand it.

Any tips, even tiny one will be useful.

Thanks

Hilaire


--
Dr. Geo - http://drgeo.eu
iStoa - http://istoa.drgeo.eu


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: MAToOneRelationDescription display

Stephan Eggermont-3
Hi Hilaire,

I'm afraid I don't quite understand what problem you are running into.

On the class side of MAToOneRelationDescription you find the default
components that are used to render, either the MAExternalEditorComponent
or the MAInternalEditorComponent. You can override that on an individual
basis with componentClass: or you can override that systematically
as done in QCBootstrapComponentBuilder>>visitToOneRelationDescription:

"A QCDescriptionBuilder is an abstract class for enriching a Magritte description,
e.g. setting the component class based on the description class."

Stephan_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: MAToOneRelationDescription display

HilaireFernandes
Le 05/02/2015 13:36, Stephan Eggermont a écrit :
I'm afraid I don't quite understand what problem you are running into.

Hello Stephan,

Let's explain with an example:

An Address instance as bellow (with its own description):




is part of a housing instance, and there it is described as a MAToOneRelationDescription in this instance, however I don't like the way it is displayed there: see, only the field Adresse is printed (117 rue des reves), I would like the City as well to be printed (Annecy):



This is what I want to customize.

Are the class MAExternalEditorComponent or MAInternalEditorComponent the place to look?

Is subclassing mandatory to achieve that?

Thanks a lot!

Hilaire


-- 
Dr. Geo - http://drgeo.eu
iStoa - http://istoa.drgeo.eu

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: MAToOneRelationDescription display

HilaireFernandes
Responding to myself, I added to the model description:

        reference: (MAContainer with:
            (MAStringDescription new selectorAccessor: #printString;
yourself));

and I overrided printOn: on the model.

But it really looks like voodoo and I don't feel comfortable with that...

Hilaire


Le 06/02/2015 08:55, Hilaire a écrit :
> Le 05/02/2015 13:36, Stephan Eggermont a écrit :
>> I'm afraid I don't quite understand what problem you are running into.
>
> Hello Stephan,
>
> Let's explain with an example:


--
Dr. Geo - http://drgeo.eu
iStoa - http://istoa.drgeo.eu


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside