| Issue 12: | XMLArray issues | |
| 3 people starred this issue and may be notified of changes. | Back to list |
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
May 31, 2009
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
May I suggest using the FlexXB discussion group for such discussions? :D
May 31, 2009
I don't seem to get notified when an issue is posted
May 31, 2009
I tryed both solutions above but still not working :( Im going to the discusion group :D
May 31, 2009
(No comment was entered for this change.)
Status:
Fixed
Jul 17, 2009
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
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
(No comment was entered for this change.)
Status:
Verified
|