简体   繁体   English

如何使用拆分视图导航器在主视图和详细视图之间传递数据

[英]How to pass Data between Master and detail view w/Split view navigator

I am building an application that the split view navigator would work very effectively. 我正在构建一个可以使分割视图导航器非常有效地工作的应用程序。 My only problem I am running into is passing data between the master view which holds my list of things to click and the detail view which is supposed to show the information of the button clicked. 我遇到的唯一问题是在保存要单击的事物的主视图和应该显示单击按钮信息的详细视图之间传递数据。 I am using Flex 4.6. 我正在使用Flex 4.6。 The information For example my buttons would be "Take in Information" , "Customer Information" and "Acceptance of Service". 信息例如,我的按钮将是“接收信息”,“客户信息”和“服务接受”。 In each of those buttons I would need forms to be displayed when the button is clicked. 在每个按钮中,单击按钮时都需要显示表格。 Lynda.com doesn't explain how to pass data in the split view navigator. Lynda.com没有解释如何在拆分视图导航器中传递数据。 Any help would be greatly appreciated. 任何帮助将不胜感激。

This Flex documentation on the SplitViewNavigator may help. SplitViewNavigator上的Flex文档可能会有所帮助。

Basically, the Navigator is just like any other navigator. 基本上,导航器就像其他导航器一样。 When you push a view onto it you can send data in. To copy code from the above link. 将视图推入视图时,可以发送数据。要从上面的链接复制代码。 This code would be in your "Master" view: 该代码将在您的“主”视图中:

protected function myList_changeHandler(event:IndexChangeEvent):void {
    // Create a reference to the SplitViewNavigator.
    var splitNavigator:SplitViewNavigator = navigator.parentNavigator as SplitViewNavigator;

    // Create a reference to the ViewNavigator for the Detail frame.
    var detailNavigator:ViewNavigator = splitNavigator.getViewNavigatorAt(1) as ViewNavigator;

    // Change the view of the Detail frame based on the selected List item.
    detailNavigator.pushView(DetailView, myList.selectedItem);
}

Here is a write up on passing data between views that may provide more information. 这是关于在视图之间传递数据可能会提供更多信息的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM