RE: [flexcoders] accessing returned ValueObject properties in mxml file

2005-08-03 Thread Matt Chotin










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.



  











[flexcoders] accessing returned ValueObject properties in mxml file

2005-08-03 Thread cruegger2000

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:
  

  

  
  
  

  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?
  }










 Yahoo! Groups Sponsor ~--> 
http://us.ard.yahoo.com/SIG=12h7d998l/M=362131.6882499.7825260.1510227/D=groups/S=1705007207:TM/Y=YAHOO/EXP=1123094472/A=2889191/R=0/SIG=10r90krvo/*http://www.thebeehive.org
">Get Bzzzy! (real tools to help you find a job) Welcome to the Sweet Life 
- brought to you by One Economy.
~-> 

--
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

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/