Expand my Community achievements bar.

missing declared association property

Avatar

Former Community Member

A fill command like so:
<mx:Button label="Fill" click="{se.fill(entitymaps)}"/>

In this data service:
<mx:DataService id="se" destination="entityds"/>

Gives the following stack trace:
Error: Item added to destination: entityds of type: maps::EntityMap is missing declared association property: children
    at mx.data::ConcreteDataService/http://www.adobe.com/2006/flex/mx/internal::checkAssociations()[C:\depot\DataServices\branches\lcds26_hotfixes\frameworks\projects\data\src\mx\data\ConcreteDataService.as:2154]
    at mx.data::DataList/http://www.adobe.com/2006/flex/mx/internal::processSequence()[C:\depot\DataServices\branches\lcds26_hotfixes\frameworks\projects\data\src\mx\data\DataList.as:2060]
    at mx.data::DataList/http://www.adobe.com/2006/flex/mx/internal::processSequenceResult()[C:\depot\DataServices\branches\lcds26_hotfixes\frameworks\projects\data\src\mx\data\DataList.as:2284]
    at DataListRequestResponder/result()[C:\depot\DataServices\branches\lcds26_hotfixes\frameworks\projects\data\src\mx\data\ConcreteDataService.as:7283]
    at mx.rpc::AsyncRequest/acknowledge()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:74]
    at NetConnectionMessageResponder/resultHandler()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\messaging\channels\NetConnectionChannel.as:515]
    at mx.messaging::MessageResponder/result()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\messaging\MessageResponder.as:199]

When the 'children' property of EntityMap is not declared, EntityMap looks like this:
package maps
{
    import mx.collections.ArrayCollection;
   
    [Managed]
    [RemoteClass(alias="alex.onetomany.Entity")]
    public class {   
        public function EntityMap() {}      
        public var name:String;
        public var identity:String;

    }
}

Despite the fact that the entityds destination looks like this......

<destination id="entityds">
        <properties>
            <source>alex.onetomany.EntityAssembler</source>
            <scope>application</scope>
            <metadata>
                <identity property="identity"/>
            </metadata>
            <network>
                <paging enabled="false" pageSize="10" />
            </network>
        </properties>
    </destination>

...the problem still seems to occour. The strangest thing is when I rename the destination from entityds to 'blah' (on the server in data-management-config.xml and on the client in my MXML file OneToManyTest.mxml) the error no longer happens.
Questions:
1) When exactly is the missing declared association property: supposed to appear? Is it when you add some associated property in data-management-config.xml, if so....
2) How come it does not appear for the nodeds data service when I give it a similar children property on-to-many configuration in data-management-service.xml like so:

    <destination id="nodeds">
        <properties>
            <source>alex.onetomany.NodeAssembler</source>
            <scope>application</scope>
            <metadata>
                <identity property="identity"/>
                <one-to-many property="children" destination="nodeds"
                    load-on-demand="true"
                    read-only="true"
                    lazy="false"/>
            </metadata>
            <network>
                <paging enabled="false" pageSize="1" />
            </network>
        </properties>
    </destination>
3) Most importantly: why does it appear for entityds and only when the destination is called entityds and nothing else.

0 Replies