Code Serialization Inconsistency - Forum - OpenEdge Development - Progress Community
 Forum

Code Serialization Inconsistency

This question is not answered

What triggers PDS to serialize unmodified custom properties of UserControl and custom Control to the InitializeComponent block? And sometimes it doesn't?

It's a pain when the serialized value of the property becomes out-of-synch with the UserControl.

All Replies
  •  
    What gets written out is controlled by a combination of the widget itself and the Microsoft .NET code dom serializer.
     
    PDSOE doesn’t control it.  The widget designer class (if it has one) and the annotations on its properties control the serialization.
     
    The PDSOE portion of the serialization writes the code dom instructions out as ABL syntax.
     
    If you’re UserControl class is written as an ABL  class then due to ABL limitations, and the properties that would normally prevent default value serialization are not present as the ABL doesn’t support annotations.
     
     
    mattB
     
  • With ABL properties on hybrid user controls, you should not rely on the implicit initial value.
     
    DEFINE PUBLIC PROPERTY xyz AS CHARACTER INIT “” .
     
    will not be written to the Form’s initializeComponent method when the property’s value is “”. But
     
    DEFINE PUBLIC PROPERTY xyz AS CHARACTER.
     
    will. So always define an explicit initial value.

    Architect of the SmartComponent Library and WinKit

    Consultingwerk Ltd.

  • My problem is that for the same UserControl, PDSOE sometimes includes and sometimes it doesn't include property initialization in IntializeComponent. I'm wondering what is causing the inconsistency to happen.

    Is it the presence of r-code, location of r-code and etc.?