MAToOneRelationDescription dispaly data

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

MAToOneRelationDescription dispaly data

dtrussardi@tiscali.it
Hi All,
my english language is very limited, i'm sorry.
 
I have a PersonModel with some descriptions.
 
One of it, descriptionAddress is  based on MAToOneRelationDescription
with componentClass: MAExternalEditorComponent
  and classes: ( Array with: MAAddressModel )
 
When rendering PersonModel  asComponent for the descriptionAddress the system
display the relative low priotity description near the Remove and Edit buttons.
 
I need to dispaly more data near the button.
 
I have add, to the descriptionAddress definition the:
 reference:  ( MAAddressModel descriptionCity, MAAddressModel descriptionRegion)
 
but d'ont work well.
 
The same problem i found in MASingleOptionDescription where reference: d'ont work.
For MASingleOptionDescription i have solve with optionsAndLabels:
 
In the MAToManyRelationDescription the reference: define the data to display for any item.
 
I think same behaviour in MAToOneRelationDescription and MASingleOptionDescription but i wrong. ?!
 
My question now is:
 
how i can display some  data near the Remove / Edit buttons  relative to the MAAddressModel instance.
 
Cheers,
 
Dario

 



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

Re: MAToOneRelationDescription dispaly data

Lukas Renggli-2
> I need to dispaly more data near the button.

This means you want a different string to be displayed?

> I have add, to the descriptionAddress definition the:
>  reference:  ( MAAddressModel descriptionCity, MAAddressModel  
> descriptionRegion)

If so, try this

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

and implement your own printOn: method in your referenced object as  
you wish.

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: MAToOneRelationDescription dispaly data

dtrussardi@tiscali.it
In reply to this post by dtrussardi@tiscali.it
> I need to dispaly more data near the button.

| This means you want a different string to be displayed?
 
Yes


> I have add, to the descriptionAddress definition the:
>  reference:  ( MAAddressModel descriptionCity, MAAddressModel 
> descriptionRegion)

| If so, try this

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

| and implement your own printOn: method in your referenced object as 
| you wish.

I've test this solution but d'ont work.
 
The printOn: method in my referenced object is never call.
 
I work with vw7.5 and seaside 2.8a1.
 
Cheers,
Dario
 


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

Re: MAToOneRelationDescription dispaly data

Lukas Renggli-2
> | If so, try this
>
> | reference: (MAContainer with: (MAStringDescription new
> | selectorAccessor: #printString; yourself))
>
> | and implement your own printOn: method in your referenced object as
> | you wish.
>
> I've test this solution but d'ont work.
>
> The printOn: method in my referenced object is never call.
>
> I work with vw7.5 and seaside 2.8a1.

This is odd, because it works on Squeak.

Actually in Squeak you don't even need to specify any reference  
description, because the default is an MAStringDescription what causes  
#asString to be sent to the object.

Since you are on VisualWorks #asString might not work as expected.  
Maybe you want to try and implement it yourself on your object and  
don't specify any reference description?

I added a test in Squeak that should find that kind of bug.

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: MAToOneRelationDescription dispaly data

Lukas Renggli-2
Mhh, I just noticed that there is a possible bug in  
MAExternalEditorComponent related to printing one-to-one relations.  
This is ready to review in Magritte-Seaside-lr.261.

Lukas


On Apr 29, 2008, at 17:01 , Lukas Renggli wrote:

>> | If so, try this
>>
>> | reference: (MAContainer with: (MAStringDescription new
>> | selectorAccessor: #printString; yourself))
>>
>> | and implement your own printOn: method in your referenced object as
>> | you wish.
>>
>> I've test this solution but d'ont work.
>>
>> The printOn: method in my referenced object is never call.
>>
>> I work with vw7.5 and seaside 2.8a1.
>
> This is odd, because it works on Squeak.
>
> Actually in Squeak you don't even need to specify any reference
> description, because the default is an MAStringDescription what causes
> #asString to be sent to the object.
>
> Since you are on VisualWorks #asString might not work as expected.
> Maybe you want to try and implement it yourself on your object and
> don't specify any reference description?
>
> I added a test in Squeak that should find that kind of bug.
>
> Lukas
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
>
>
> _______________________________________________
> SmallWiki, Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki

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


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