Yes, I knew about #description on the instance side, but my question was
not precise enough. I wanted an on-the-fly description for the
collection so that the MAReport is dynamically configured.
I finally got the desired behavior simply by subclassing
MAOneToManyComponent and re-implementing #reference. This also gave me
the possibility to offer a UI on the description for hiding/showing
columns in the report. Magritte is really cool.
Thanks,
Michel.
-----Original Message-----
From: smallwiki-bounces(a)iam.unibe.ch
[mailto:smallwiki-bounces@iam.unibe.ch] On Behalf Of Lukas Renggli
Sent: vendredi, 21. mars 2008 18:33
To: Magritte, Pier and Related Tools ...
Subject: Re: Instance based description in Magritte
The description of the objects in class B needs
to be
instance based.
All the objects in one collection have the same
description, however
class B is not able to provide a description.
You can override #description on the instance side to either
build your descriptions on the fly or to modify the ones
returned by the class. For example:
B>>description
^ super description collect: [ :each |
(each isKindOf: MAToManyDescription)
ifTrue: [ each copy classes: self dynamicClasses ]
ifFalse: [ each ] ]
You find many other possible solutions in the mailing-list
archive and some additional information in the FAQ:
http://www.lukas-renggli.ch/smalltalk/magritte/faq
Lukas
--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki