Just pull off the properties. If you didn’t
do a registerClass you’ll get a regular object back that should have the
properties for anything where you had a getter in your Java class.
Matt
From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of cruegger2000
Sent: Wednesday, August 03, 2005
9:41 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] accessing
returned ValueObject properties in mxml file
I want to access the properties of a Value Object
returned from a
Java business delegate to populate some flex
controls (label text,
grid data, etc.). However, I do not want to
have to write an
analogous Value Object class in ActionScript code
(don't want to have
to keep them in synch). Is this possible? If so,
how? I have not been
able to find documentation that addresses this.
Here are background details:
On the server side I have:
--
public class HelloDelegate
{
public HelloVO getHello()
{
return new HelloVO();
}
}
public class HelloVO implements Serializable
{
private int id;
private String name;
// get accessors for id and name
}
On the client side I have:
--
hello.mxml:
result="event.call.resultHandler(event.result)"
source="com.delegate.hello.HelloDelegate">
public function getHello():Void
{
var pendingCall =
helloDelegate.getHello();
pendingCall.resultHandler =
mx.utils.Delegate.create(this,gotHello);
}
private function gotHello(result) : Void
{
// At this point result is a
HelloVO value object. How can I
// access id and name
properties here?
}
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
YAHOO! GROUPS LINKS
Visit your group "flexcoders" on the web.
To unsubscribe from this group, send an email to: [EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.