If everything is working right, event.target.selectedItem should be typed as a 
headlineVO. Check with Charles as to what type of object is actually being 
returned.

--- In [email protected], Greg Morphis <gmorp...@...> wrote:
>
> event.target.selectedItem says it's Object (@b3063a9) but lists all of
> the variables: actiondate, actionuser, effdate, endeffdate, headline,
> headline_id of my VO it also has a mx_internal_id
> 
> but I check 'this.currentVO' and it shows "null" after the assignment:
> currentVO = event.target.selectedItem as headlineVO;
> 
> currentVO is declared as a headlineVO as the top of the mxml page..
> 
> [Bindable]
> private var currentVO:headlineVO = new headlineVO();
> 
> In my headlineVO.as I'm linking to my bean
> [RemoteClass(alias="Arc.model.Headlines.headline")]
> 
> I'm missing something... currentVO shouldnt be null
> 
> 
> 
> On Fri, Mar 13, 2009 at 3:18 PM, ppongtong <ppongt...@...> wrote:
> > Please try
> > <mx:DataGrid itemClick="selectedHeadline()"...
> >
> >
> > --- In [email protected], Greg Morphis <gmorphis@> 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.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > Alternative FAQ location: 
> > https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
> > Search Archives: 
> > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
> >
> >
> >
> >
>


Reply via email to