开发者

Flex application layers

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 th开发者_如何转开发e previous 2

Which is the best practice here ?

Thanks.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜