This has been driving me crazy for a day!
 
I have defined my XMLListCollection as follows:
 
 <mx:XMLListCollection id="customAttributes">
  <mx:XMLList xmlns="">
   <custAttr label="myCustomer" value="Big Cheese, Inc."/>
   <custAttr label="serverRoom" value="Ice Box"/>
   <custAttr label="tempThreshold" value="52"/>
  </mx:XMLList>
 </mx:XMLListCollection>
I have a button and I want to add a new item to it. I've defined it as follows:
 
<mx:Button label="Add" click="customAttributes.addItem({'label':'New Custom Attribute', 'value':'New Value'});"/>
 
Needless to say, it doesn't work. I get the following error message:
 
Error: Incorrect type. Must be of type XML or a XMLList that contains one XML object.
 at mx.collections::XMLListAdapter/addItemAt()
 at mx.collections::ListCollectionView/addItemAt()
 at mx.collections::ListCollectionView/addItem()
 at main/___Button2_click()
Does the syntax I'm using for the addItem only work for arrays? Is there an equivalent inline syntax for creating "one XML object" that addItem will accept for my XMLListCollection?
 
Thanks,
Jeff
__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to