Missing fields

6 views
Skip to first unread message

Yonas

unread,
Aug 23, 2011, 3:11:35 PM8/23/11
to FxWorks
Hi Alex

I'm working on a project where objects retrieve varying pieces of data
from different calls, each one setting more properties on the object.
The problem is that FlexXB seems to treat missing elements and
attributes as null and sets the object properties as such. That means
subsequent calls which retrieve data for an object that has already
been serialised and is kept in a cache provider gets its properties
nulled by any fields that are missing in the new call.
Is this the intended functionality? If so, if might be nice to check
for missing elements and attributes and then not set the value as
null, or at least add another field in the parsley tag that either
turns this on, or off if you changed the default behaviour. I realise
that some backend xml serializers simply ommit null fields, but some
way to control this would be nice.

Perhaps there is already a way to do this and I've missed it.
As always, great work, and thanks again for this amazing library!

Yonas

Alexutz

unread,
Sep 1, 2011, 7:56:20 AM9/1/11
to FxWorks
Hello,

Sorry for the late response. This is an interesting issue. I'll look
into it; I think a setting in configuration allowing you to control
this behavior would be best.

Alex

Yonas

unread,
Sep 22, 2011, 6:53:15 AM9/22/11
to FxWorks
Hi Alex

Putting it in configuration is a good idea.
Any progress on this? If not I can write my own fix, as I need it for
a project

Thanks
Yonas

Alexutz

unread,
Sep 22, 2011, 4:52:34 PM9/22/11
to FxWorks
Hi,

Sorry for taking so long to fix this. I've been pretty busy with a
commercial project I'm working on.
I committed the enhancement. Let me know how it works for you. The
test I ran says it should be ok.

Alex
> > > Yonas- Ascundeţi textul citat -
>
> - Afişare text în citat -

Yonas

unread,
Sep 22, 2011, 6:11:07 PM9/22/11
to FxWorks
Oh wow, thanks Alex, this is fantastic, just what I needed!
I can see that it only works for attributes and elements though. Is
there a way to get it to work for array as well? I tried to change it
myself so it would call signalMissingField in XmlArraySerializer but I
can't see a way of distinguishing between empty and non existant
arrays in deserializeObject.
Reply all
Reply to author
Forward
0 new messages