Try changing getID to getId and setID to setId.

--- In [email protected], "ytseshred" <[EMAIL PROTECTED]> wrote:
>
> I'm properly retrieving a result set from my database, but the
> serialization from Java to ActionScript screws up my id field along
> the way.
> 
> ----------
> 
> My Java VO:
> 
> public class TestVO {
> 
>   private int id;
>   private String data;
> 
>   public TestVO() { }
> 
>   public TestVO(int id, String data) {
>     this.id = id;
>     this.data = data;
>   }
> 
>   public getID() { return id; }
> 
>   public setID(int id) { this.id = id; }
> 
>   public getData() { return data; }
> 
>   public setData(String data) { this.data = data; }
> 
> }
> 
> -------------------
> 
> My ActionScript VO:
> 
> public class TestVO {
> 
>   public var id:int;
>   public var data:String;
> 
> }
> 
> --------
> 
> ActionScript outputting the data (the ArrayCollection of my TestVO's
> are bound to a list with the following renderer:
> 
> <?xml version="1.0" encoding="utf-8"?>
> <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml";>
> 
>   <mx:Script>
>     <![CDATA[
>       import mx.events.FlexEvent;
> 
>       import test.vo.TestVO;
> 
>       private var vo:TestVO;
> 
>       [Bindable]
>       private var str:String;
> 
>       override public function set data(val:Object):void {
>          if(val != null) {
>            super.data = val;
>            vo = val as TestVO;
>            str = vo.id + " " + vo.data;
>          }
>          dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));
>       }
>     ]]>
>   </mx:Script>
> 
>   <mx:Label text="{str}" />
> 
> </mx:HBox>
> 
> When displaying the data in a list I see data field properly, but
> every id displays as 0 in Flex.  I've output the records on a JSP page
> which uses the same DAO, and the records output properly, so I know
> it's getting out of the database properly.
> 
> Any suggestions?
>


Reply via email to