This almost sounds like it could be related to actionscript not having the correct Java mappings.  This can cause these types of headaches.

 

Try creating dummy variables for all the classes used in the transaction at Flex application layer. I.E. var dummyObject : DummyObject (Where DummyObject is your actual ActionScript class)

 

Here’s why:

 

Let’s say you have a one-to-many relationship with 2 objects.  If Object1 has many Object2s, then Object1 should have an array containing multiple Object2s.  If Object2 has never been declared in actionscript yet, then Object2 will be undefined (Yet you will be able to trace it’s properties…)

 

Make sure Object1 is registered with actionscript (Object.registerClass) and Object2 is also registered with Actionscript (Try making dummy variables for each of these).  Since the Object.registerClass is in the AS class, it will only be executed if the class has been declared in your application somewhere.  Complex objects will come back as undefined if they don’t have mapped AS counterparts.

 

The reason there may not be a pattern to this is because certain objects will be declared in certain methods only, and those methods may not be executed yet.  Object Casting can also be enough to kick in the object mappings.  That’s why you usually don’t have to declare any dummy variables.

 

Dustin Mercer

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of JesterXL
Sent: Wednesday, September 28, 2005 8:23 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Flex with EJB3

 

...hey, I'm with you about breaking the elegance, but if I as a developer
can create ActionScript objects, and you as the Java developer can
understand them, who cares if the underpinnings aren't elegant, it works.

Still, it'd be nice to know what is going on...

----- Original Message -----
From: "Björn Abt" <[EMAIL PROTECTED]>
To: <flexcoders@yahoogroups.com>
Sent: Wednesday, September 28, 2005 10:30 AM
Subject: AW: [flexcoders] Flex with EJB3


Hi!

Thanks for the quick answer. Well, the EJB3 EntityBeans are basically
POJO's.
The Beans get deserialized and reach the Flash-App. It fails only when a
ManyToMany
Relationship exists, but not all the time. Sometimes they get deserialzed
and sometimes not.
There isn't really a pattern, or at least none that i can see. Maybe i have
to rebuild the Model
with plain POJO's, but this would in a way break the elegance of the
system...

Thanks Bjoern



--
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
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to