Skip to main content



      Home
Home » Archived » Sapphire » initialize() method not propogating to child types reference via possible attribute in Type annotati
initialize() method not propogating to child types reference via possible attribute in Type annotati [message #1740007] Mon, 08 August 2016 01:11 Go to next message
Eclipse UserFriend
I have a model which basically models a xsd choice by using the following Type annotation:

@Type(base = TemplateData.class, possible = { FlatTemplateData.class, XmlTemplateData.class })
@XmlElementBinding(path = "templateData", mappings = {
@XmlElementBinding.Mapping(element = "flatTemplateData", type = FlatTemplateData.class),
@XmlElementBinding.Mapping(element = "xmlTemplateData", type = XmlTemplateData.class)
})
@Label(standard = "Template Data")
ElementProperty PROP_TEMPLATE_DATA = new ElementProperty(TYPE, "TemplateData");
ElementHandle<TemplateData> getTemplateData();

And this all works fine in the UI, except for when I call initialize() on the root type, this event is not being called on the FlatTemplateData or XmlTemplateData, so that InitialValues, etc are not being setup for an instance of FlatTemplateData or XmlTemplateData

I am working around this by explicitly calling the initialize() method on the getTemplateData().content()

Is this a bug or do I need to do something else to get the initialize process to correctly propogate to the correct child class?

[Updated on: Mon, 08 August 2016 01:11] by Moderator

Re: initialize() method not propogating to child types reference via possible attribute in Type anno [message #1740169 is a reply to message #1740007] Tue, 09 August 2016 20:45 Go to previous message
Eclipse UserFriend
The initialize() is called when a new element is added as a root or as child to an existing model. Initialization only traces down into implied element properties. Explicit element properties (like in your example) and list properties are ignored as they aren't expected to hold any content at that point.

Why do you need to call this method explicitly?
Previous Topic:Stop Column Sorter in a List Property Editor
Next Topic:Localization
Goto Forum:
  


Current Time: Sun May 04 19:45:20 EDT 2025

Powered by FUDForum. Page generated in 0.03046 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top