issue with PRComponent when porting to Pier3

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

issue with PRComponent when porting to Pier3

Yanni Chiu
All my tests passed, and I thought I was done porting - it's never that
easy.

So, the problem I have is with PRComponent. In my case, the magritte
description of componentClass is dependent on one of the
prototypeInstance's values. Things worked before there was a prototype
instance, just using the componentClass. Now, there is a problem in:

   initializeVisualComponentSettings: aComponent link: anInternalLink

At this point in the initialization, there is a nil value, in the place
which is used to dynamically determine what the rest of the magritte
description should be.

I think the fix is to ensure that when I have a nil value, the
corresponding magritte description generated should be appropriate for
the situation - i.e. it should not include the attribute descriptions
that are causing the problem in the above initialization.
_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: issue with PRComponent when porting to Pier3

Yanni Chiu
On 26/10/12 12:42 AM, Yanni Chiu wrote:
>
> I think the fix is to ensure that when I have a nil value, the
> corresponding magritte description generated should be appropriate for
> the situation - i.e. it should not include the attribute descriptions
> that are causing the problem in the above initialization.

Yep, that fixes it, but the next problem is in:

PRComponent>>write: anObject using: aDescription
   ...
   (self prototypeInstance magritteDescription includes: aDescription)
     ifTrue: [ self prototypeInstance write: anObject using: aDescription ]
     ifFalse: [ super write: anObject using: aDescription ] ]

Using the edit form, a nil value is set. So, correspondingly, the
magritteDescription no longer includes the dynamically generated fields.
But now the commit runs into the above code, and falls into the false
case, which fails because the PRComponent doesn't define the attribute.

Am I going about this the wrong way? Or, is this what I should expect
when messing with dynamic instance based magritte descriptions. At this
point, I think I have to specialize #write:using: in my code.

Note to anyone porting to Pier3. It all went smoothly, except for the
case above, where the custom code that handled instance based magritte
descriptions has collided with Pier3/Magritte3 take on the matter.

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