MAToOneRelationDescription error with MAInternalEditorComponent beReadonly property

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

MAToOneRelationDescription error with MAInternalEditorComponent beReadonly property

dtrussardi@tiscali.it
Hi,


when i define a description based on this code :


        ^ (MAToOneRelationDescription new)
                componentClass:   MAInternalEditorComponent      ;
                classes: (Array with: MAIndirizzoModel);
                autoAccessor: 'indirizzoMemo';
                label: 'Indirizzo';
                comment: 'Indirizzo di riferimento';
                priority: 220;
                beReadonly;
                yourself
 
where  i set  beReadonly.

A) I found error when display it into:

        renderViewerOn: html
        html render: (self component
                readonly: self isReadonly;
                yourself)

        because self component answer nil.




B) Another problem is relative to the same description when i rendering it as subComponent but with beReadonly setting.

When i do "Save" the container erase errors relative to this subcomponent descriptions .

But it's readOnly and d'ont do any control on it.




C) I'm interested to incorporate the subComponent at the first level ( without the create buttons )

I create a  MAInternalEditorComponent subclass: #MAOneToOneDirectComponent
 
and change the :

        buildComponent

        "create new default value for directly rendering the subcomponent without button "

        self value isNil ifTrue:[ self value: self selected new.
                                                        component := nil ].
       
        ^ self value isNil ifFalse: [
                (self description reference asComponentOn: self value)
                        setParent:  super;
                        yourself ]


It work fine.

But the rendering is with to level the master and the slave.

I can incorporate the slave description at first level ?


Thanks for any considerations.

        Dario



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