I was experimenting with method-invocation in Spring ActionScript 0.6.1.
In particular, I was creating an unnamed object as part of an array, and wanting to call a method in that object. In the below code, it's the category object.
It failed with a error message "The object name must have text". I could not get it to invoke a method until I added an id to the object tag.
Is this the correct behavior? I'm never going to directly refer to the category so why do I need to name it to invoke a method on it?
Code:<?xml version="1.0"?> <objects xmlns='http://www.pranaframework.org/objects' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.pranaframework.org/objects http://www.pranaframework.org/schema/objects/prana-objects-0.7.xsd' > <object id='commitListener' class='utils.AlertCommitListener'/> <object id='assessment' class='valueObjects.AssessmentImpl'> <property name='title' value='Assessing a Team'/> <property name='username' value='Demo User'/> <property name='categories'> <array> <object class='valueObjects.CategoryImpl' id='category_3'> <constructor-arg value='Approach to change'/> <method-invocation name='addCommitListener'> <arg> <ref>commitListener</ref> </arg> </method-invocation> </object> </array> </property> </object> <objects>


Reply With Quote