Andrew:
Another option would be to using JSON to serialize and deserialze data. Its part of the corelib released by Adobe. I have instructions on my blog at http://blog.shrefler.net/?p=5
for using it to transfer objects....
Hope that helps
Sam
On 9/20/06, greenfishinwater <[EMAIL PROTECTED]> wrote:
Thanks for the reply, I actually like the Flex 1.5 methodology as it
fits in with what I want to do further down the line.
I am using Flex 2.0.
I have been using models to hold VO for database usage. But I am being
drawn to using XML instead of a Model, as I can make use of all the
XML methods, to inspect and manipulate my data. Is there any downside
to using XML instead of a Model.
So my example would be:
<mx:XML id="product">
<product>
<name>{fName.text}</name>
<code>{fCode.text}</code>
<discountGroup>{fGroup.text}</discount>
</product>
<[EMAIL PROTECTED]> wrote:
>
>
> In Flex 1.5:
>
> for( var i in product ) {
> trace( i + " - " + product[i] );
> }
>
> In Flex 2.0:
>
> trace( "dump: " + ObjectUtils.toString( product ) );
>
> Enjoy!
>
> Dimitrios Gianninas
> Optimal Payments Inc
>
> -----Original Message-----
> From: [email protected] on behalf of greenfishinwater
> Sent: Tue 9/19/2006 3:46 PM
> To: [email protected]
> Subject: [flexcoders] Help on a general way to serialize a model and
its contents
>
> I have a number of models in my app and as a debugging help have an
> alert fired by a button, which gives me the content of a model.
>
> For example
> <mx:Model id="product">
> <product>
> <name>{fName.text}</name>
> <code>{fCode.text}</code>
> <discountGroup>{fGroup.text}</discount>
> </product>
> </mx:Model>
>
> Would give a string:
> name: value, code: value, discountGroup: value
>
> I do this the long way:
> m += "name: " + product.name;
> m += ", code: " + product.code;
> m += ", discountGroup: " + discountGroup;
>
> Is there an easier way to achieve this?
>
> Thanks
>
> Andrew
>
>
>
>
> --
> WARNING
> -------
> This electronic message and its attachments may contain
confidential, proprietary or legally privileged information, which is
solely for the use of the intended recipient. No privilege or other
rights are waived by any unintended transmission or unauthorized
retransmission of this message. If you are not the intended recipient
of this message, or if you have received it in error, you should
immediately stop reading this message and delete it and all
attachments from your system. The reading, distribution, copying or
other use of this message or its attachments by unintended recipients
is unauthorized and may be unlawful. If you have received this e-mail
in error, please notify the sender.
>
> AVIS IMPORTANT
> --------------
> Ce message électronique et ses pièces jointes peuvent contenir des
renseignements confidentiels, exclusifs ou légalement privilégiés
destinés au seul usage du destinataire visé. L'expéditeur original ne
renonce à aucun privilège ou à aucun autre droit si le présent message
a été transmis involontairement ou s'il est retransmis sans son
autorisation. Si vous n'êtes pas le destinataire visé du présent
message ou si vous l'avez reçu par erreur, veuillez cesser
immédiatement de le lire et le supprimer, ainsi que toutes ses pièces
jointes, de votre système. La lecture, la distribution, la copie ou
tout autre usage du présent message ou de ses pièces jointes par des
personnes autres que le destinataire visé ne sont pas autorisés et
pourraient être illégaux. Si vous avez reçu ce courrier électronique
par erreur, veuillez en aviser l'expéditeur.
>
__._,_.___
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
![]()
SPONSORED LINKS
Software development tool Software development Software development services Home design software Software development company
Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
__,_._,___
Reply via email to

