It looks ok to me too.  One thing, your result handler should be typed
ResultEvent.  Also, assigning an object makes a reference to the original
object.  Could anything be nulling that original object.

 

Tracy Spratt,

Lariat Services, development services available

  _____  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Greg Morphis
Sent: Friday, March 13, 2009 5:13 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: datagrid.selectedItem to vo?

 

In the command result I have
public function result(event:Object) : void {
MyModel.getInstance().adminARCHeadlines = new ArrayCollection
(event.result);
}

adminARCHeadlines is an ArrayCollection in MyModel.as

How do I tell it that it's an ArrayCollection of VOs?

On Fri, Mar 13, 2009 at 3:21 PM, ppongtong <ppongt...@yahoo.
<mailto:ppongtong%40yahoo.com> com> wrote:
> Actually, when u get the data from cfc, did u map it to your headlineVO?
>
>
> --- In flexcod...@yahoogro <mailto:flexcoders%40yahoogroups.com> ups.com,
Greg Morphis <gmorp...@...> wrote:
>>
>> I have a vo headlineVO that has the following variables
>> headline_id:Number
>> headline:String
>> effdate:Date
>> endeffdate:Date
>> actionuser:String
>> actiondate:Date
>> I have a cfc that returns an ArrayCollection of beans, each bean has
>> the above variables too.
>> I can populate a datagrid with this data and it shows fine.
>> I'm trying to populate a new vo (currentVO) when the user selects a
>> row and hits "edit".
>> The new VO shows as being null in the debugger.
>> This is what my code looks like
>>
>> <mx:DataGrid id="headlinesDG"
>> dataProvider="{MyModel.getInstance().adminARCHeadlines}"
>> click="selectedHeadline" ...
>> ...
>> </mx:DataGrid>
>>
>> above I have a function
>> private function selectedHeadline():void {
>> currentVO = headlinesDG.selectedItem as headlineVO;
>> }
>>
>> and for the editButton.click I have another function that just Alert
>> the currentVO.headline;
>>
>> I get a null object reference when I click on the edit Button.
>> If I put a breakpoint above the Alert I can see that currentVO is
>> null, how can I assign that selected row to my vo?
>> Can anyone offer suggestions or things I should check?
>>
>> Thanks in advance!
>>
>
>
>
>
> ------------------------------------
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.
<http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt>
yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Alternative FAQ location: https://share.
<https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e6
2079f6847>
acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
> Search Archives: http://www.mail-
<http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo>
archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
>
>
>
>



Reply via email to