My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
FAQ  
Frequent questions
Featured, Phase-Support
Updated Feb 22, 2010 by alex.id....@gmail.com

1. Specifying member type xxx for array annotations results in a Error #1065: xxx variable is not defined

Cause:

This problem might appear on all list-like fields in class definitions if the type of the list members is not used anywhere else in the application. The Flex compiler will ignore class definitions that are not explicitly used in the application, thus the #1065 will appear if FlexXB attempts to deserialize the specific object.

Resolution:

To solve this problem do one of the following:

  • Use objects of type xxx somewhere in the application;
  • Add [ArrayElementType("xxx")] annotation on the array field;
  • Explicitly include the xxx type at compile time by adding include-classes attribute in the compiler arguments.

Example:

public class Section implements IIdentifiable
{
	[XmlAttribute]
	public var id : String;

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

Thanks to willsp for bringing this to my attention

2. The annotations defined on classes and class fields or the custom annotations are ignored by FlexXB

Cause:

This problem might appear because the compiler does not retain by default user defined metadata (including FlexXB metadata).

Resolution:

To solve this problem make sure the compiler arguments are updated with the addition of the necessary metadata inclusions. For each annotation in question add: -keep-as3-metadata Annotation-Name.

Note: If you created a custom annotation you will need to make sure you overrode the annotationName getter in your custom annotation class

For the regular FlexXB annotations there probably would not be a need to manually include them in the keep metadata list since those arguments were supplied when the FlexXB swc was built. If you built the FlexXB swc yourself or if you created custom annotations to handle specific serialization/ deserialization cases, make sure all the annotations are set in the compiler argument list.

Comment by dennis.p...@gmail.com, Dec 11, 2009

Hi Alex,

My situation is I'm new to Flex and I've just inherited a Flex app at my new job. This app is using your flexxb library to output an XML file which is then modified by another team. The other team is adding nodes to the XML document and then sending it back to me.

My problem is that these new nodes are not defined in my app (think additional metadata like price), and so aren't getting pushed to the result object from the xmlData object in the deserialize function of SerializerCore?.as. Meaning, any changes the second team made to the XML document are lost if I open it in my app and then save it again.

My question is whether it is possible to include unmapped nodes in the result object as well?

I've spent quite a bit of time trying to get to this point already so I'm stuck either waiting for a really great answer from you or trying to hack this code to make it work.

Thanks in advance for getting back to me. -Dennis

Comment by project member alex.id....@gmail.com, Dec 11, 2009

Hmmm... Interesting question. If I understand correctly, you have an object decorated with the proper FlexXB annotations. You serialize it, send it, somewhere it's caught, processed, some nodes are added and sent back to you.

Now, there are a couple scenarios:

  1. The new nodes have proper fields defined in the object, but no annotations are done on those fields. If you can alter the object's class, then you can easily add the missing annotations. Otherwise, that is, if you can't change the object class, I suggest using the API FlexXB provides in order to programatically describe your class and register it in the FlexXB runtime. Take a look at the Usage wiki page to see detailed examples on how to use it.

2. The new nodes do not have proper fields defined in the object. In this case you'd need to extend the object, add the new fields and put the annotations on them. Also you need to make sure you use this class instead of the old one.

I think these should be all. It should get you out of your predicament. If you have anymore problems, don't hesitate to contact me further. Also, I suggest using the group; it allows for a better track of replies :D

Good luck!

Alex

Comment by dennis.p...@gmail.com, Dec 11, 2009

Alex,

Thanks for the super quick reply! I'm going to follow up with you on the group right now.

-Dennis

Comment by costinal...@gmail.com, Jan 25, 2010

Hi, i've got a list of strong typed objects coming from xtreame(java) and basically i need to deserialise the whole list as an arraycollection in flex. I found a really ugly workout wrapping the xml from the server into another xml tag associated with a custom class extending arraycollection but you might have a better more straitghtforward solution... whould you give me a hint on that? Tx a lot !

Costin

Comment by project member alex.id....@gmail.com, Jan 25, 2010

Could you provide some more details on this? Such as how the xml looks like, etc. Also please move the request to the discussions group.

Thanks, Alex

Comment by costinal...@gmail.com, Jan 28, 2010

Tx a lot. I'll do that. _

Comment by evan.p.h...@gmail.com, Feb 19, 2010

I'm also using Xstream in java to build xml from transfer objects, and i've encountered a problem with empty strings. When they are serialized by Xstream, I get xml similar to this: <xml> <emptyString></emptyString> </xml> Once this is serialized by FlexXB, this is converted into null instead of an empty string. I've looked through the API and don't see an easy fix for this. Is this the intended operation? Should I just use a custom function to look for an empty tag and manually set an empty string for the variable's value in that case?

Comment by project member alex.id....@gmail.com, Feb 20, 2010

I'll look into it and let you know

Comment by ncar...@gmail.com, Mar 3, 2010

Hello Alex,

First, thanks for the tool, love it!!! Can you provide me with a sample of how to handle dates. I am using W3C formatting but must be missing something as I am unable to get my dates to deserialize correctly.

Thanks again,

Nathan Carnal

Comment by project member alex.id....@gmail.com, Mar 4, 2010

Hi,

You need to make sure the W3CDateConverter is registered with FlexXB. By default, that converter is not registered. In order to register it you must use: FlexXBEngine.instance.registerSimpleTypeConverter(new W3CDateConverter()).

Alex

P.S: Please use the discussions group if you need further assistance.

Comment by vhemaki...@gmail.com, Oct 19, 2014

Hi,

I want to generate the xml in below format. Could you please help me how to write VO

<Labels> <Label></Label> <Label></Label> <Label></Label> </Labels>

Powered by Google Project Hosting