简体   繁体   中英

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. 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. Any help would be greatly appreciated.

This Flex documentation on the SplitViewNavigator may help.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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