|
FAQ
1. Specifying member type xxx for array annotations results in a Error #1065: xxx variable is not definedCause: 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:
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 FlexXBCause: 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. | |
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
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:
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
Alex,
Thanks for the super quick reply! I'm going to follow up with you on the group right now.
-Dennis
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 !
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
Tx a lot. I'll do that. _
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?
I'll look into it and let you know
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
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.
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>