Magritte tutorial / MAReport

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

Magritte tutorial / MAReport

Florian Obser
Hi,

in the magritte tutorial excercise the report is created with:
  MAReport rows: self persons description: MAPersonModel description

The result is a table with
 - an home address column displaying the street but not the complete
   address
 - a phone numbers column displaying the "kind" fields separated by
   commas but not the numbers

Why is that?
How do I get the complete address?

Exercise 13 filters the columns to only display firstName, lastName,
email, and nationality.

How would I go about displaying the number field of the first phone number?

Thanks,

Florian

--
If c++ had garbage collection most programs would delete themself upon
execution.

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

Re: Magritte tutorial / MAReport

Lukas Renggli
> The result is a table with
>  - an home address column displaying the street but not the complete
>   address
>  - a phone numbers column displaying the "kind" fields separated by
>   commas but not the numbers
> Why is that?
> How do I get the complete address?

Have a look at MAStringWriter, this is what is used to convert an
object to a string that is then displayed in the table cell. In the
case of the MARelationDescriptions passes on to the MAContainer of the
row-object, that just takes the first visible descriptions and prints
this value.

To have a different print string in your tables you have (at least)
two possibilities:

- Add a read-only description to the beginning of the referenced
container description that calls a custom print method.

- Use a different MAStringWriter implementation that you implement and
provide yourself.

Cheers,
Lukas

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

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