Issue 12: XMLArray issues
Status:  Verified
Owner: ----
Closed:  May 2009
Reported by bruno.ro...@gmail.com, May 31, 2009
Like you said, If I encounter issues... :)

2 hours I'm trying to get the XMLArray working and still nothing.. could 
you provide me more informatin on the usage ?

Here is what I do :

<section id="section1" >
       <units>		
    	        <unit id="unit1" size="5">		
		</unit>    
    	        <unit id="unit1" size="5">		
		</unit>  
	</units>
</section>

and I declared :

package model
{
		import com.googlecode.flexxb.IIdentifiable;
	
	[XmlClass(alias="section")]
	[Bindable]
	public class Section implements IIdentifiable
	{

		[XmlAttribute]
		public var id : String;

		[XmlArray(alias="units",type="model.Unit")]
		public var units : Array;
...

and 

package model
{
		import com.googlecode.flexxb.IIdentifiable;
	
	[XmlClass(alias="unit")]
	[Bindable]
	public class Unit implements IIdentifiable
	{

		[XmlAttribute]
		public var id : String;
		
		[XmlAttribute]
		public var size : int;	

...

I'd like to get an Array of Units inside my section but what I got is an 
empty array (length 0) and this error in the console at run time :
[SWF] test.swf - 1 254 891 bytes after decompression
ReferenceError: Error #1065: Unit variable is not defined

I assure you that Unit is in the model.Unit package !!!

Thanks in advance for your help

May 31, 2009
Project Member #1 alex.id....@gmail.com
Try [XmlArray(alias="units",type="model::Unit")]

May 31, 2009
Project Member #2 alex.id....@gmail.com
Oh, and another thing:
It is possible your Unit class isn't referenced in the application, like:
var unit : Unit = new Unit().

The compiler automatically ignores classes that are not actively used in the 
application.

I think this is the problem here.
May 31, 2009
Project Member #3 alex.id....@gmail.com
May I suggest using the FlexXB discussion group for such discussions? :D
May 31, 2009
Project Member #4 alex.id....@gmail.com
I don't seem to get notified when an issue is posted
May 31, 2009
#5 bruno.ro...@gmail.com

I tryed both solutions above but still not working :(
 
Im going to the discusion group :D 
May 31, 2009
Project Member #6 alex.id....@gmail.com
(No comment was entered for this change.)
Status: Fixed
Jul 17, 2009
#7 wil...@gmail.com
i have the same problem and resolve using this...

[XmlArray(alias="elements", memberName = "elementStructure", type = 
"br.com.blabla.guarana.workflow.ElementStructure")]
[ArrayElementType("br.com. blabla.guarana.workflow.ElementStructure")]
public var elements:Array;
Jul 17, 2009
Project Member #8 alex.id....@gmail.com
Hmm... thats a good point. Missed that builtin annotation. This problem arises from 
the fact that that element is not used in the application. Not being used, the 
compiler does not include that class in the compiled swc. I will better add a FAQ on 
using this.
Dec 28, 2009
Project Member #9 alex.id....@gmail.com
(No comment was entered for this change.)
Status: Verified