Does MyModel handle the relationship between mySelectedRow and
SelectedBudgetAC?  Using setters or getters?

Tracy

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Greg Morphis
Sent: Monday, October 06, 2008 7:48 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] handling data within a datagrid

 

I've got my datagrid populating but I need to see that data in aother
location within my app.
In my MyModel.as
I have a "global" variable
public var mySelectedRow:ArrayCollection;

I've tried setting this variable in the dataGrid change event...
public function handleChangeEvent(event:Event):void
{
MyModel.getInstance().mySelectedRow = event.target.selectedItem as
ArrayCollection;
Alert.show(MyModel.getInstance().SelectedBudgetAC.getItemAt(0).amount);
var evt:CairngormEvent = new
CairngormEvent(MyControl.EVENT_GET_DATA_DETAILS);
CairngormEventDispatcher.getInstance().dispatchEvent(evt); 

}

The Alert returns a null error.. but it looks like it should be working?
What I'm trying to do is I have a VO I need to populate.. I was going
to do that within a command (is that best practice? -- to seperate
display from logic)
So anywho I'm trying to populate that arraycollection and then in the
command do all the fun stuff...
var myVO:FootVO = MyModel.getInstance().FooVO;
myVO.amount =
MyModel.getInstance().SelectedBudgetAC.getItemAt(0).amount;

but I'm getting a null error.. is this the proper way to load a VO
from a selected DataGrid row?

Thanks

 

Reply via email to