0

I'm new to Flex and I want to separate app tiers/components as much as possible.

So I have three mxmls:

  1. X.mxml which has a datagrid with students
  2. Y.mxml which must be able to tell which student is selected in the X.mxml's datagrid (row id ?)
  3. XY.mxml which uses the previous 2

Which is the best practice here ?

Thanks.

klen
  • 27
  • 1
  • 3

1 Answers1

1

For this I use an MVC framework, specifically Robotlegs. Robotlegs is simple to use and allows you to create mediators for your components. Here is a video I recorded going through some simple steps for wiring an application.

That said, your components can communication via XY. Y will have a public property called selectedStudent which can be bound to the selectedItem property of X:

<Y selectedStudent="{X.dataGrid.selectedItem}"/>

So, when the selected item is updated, it updates the selected student property.

Joel Hooks
  • 6,465
  • 4
  • 33
  • 39
  • Joel, I have 2 mxml files(rateNav.mxml and addBrs.mxml) I'm calling addBrs via popupmanager both of which are TitleWindows. How do I call members/fields that are within rateNav from addBrs? – jr3 Nov 26 '09 at 18:21