Mapping Custom Context Elements to View Context Elements

In this step you will learn how to map context elements of the custom controller FlightListCust to the appropriate context elements of the the views SearchView and ResultView.

Prerequisites

The structure of your project TutWD_FlightList_Init is currently displayed in the Web Dynpro Explorer.

Procedure

Adding dependencies to the views

...

...

       1.      In the project structure, double-click the node for the SearchView (Web Dynpro ® Web Dynpro Components ® FlightListComp ® Views  ® SearchView).

The View Designer for the SearchView appears.

       2.      Choose the Properties tab.

       3.      Under Required Controllers, choose Add.

       4.      In the list that appears, choose the FlightListCust component.

       5.      Confirm by choosing OK.

       6.      Repeat steps 1-5 as appropriate for the ResultView view.

You have now entered the appropriate dependency on the custom controller FlightListCust for each view.

Creating a context for the SearchView

...

...

       1.      Open the View Designer for the SearchView again.

       2.      Choose the Context tab.

       3.      Open the context menu for the root node  Context and choose the option New ® Model Node.

       4.      Enter the name Bapi_Flight_Getlist_Input for the model node and choose Finish.

       5.      From the context menu of the model node that you have created, choose Edit Context Mapping…

       6.      Choose the custom context node Bapi_Flight_Getlist_Input, followed by Next.

       7.      Activate only Destination_From and Destination_To. Choose Finish.

The Developer Studio refreshes the context tree appropriately.

Creating a context for the ResultView

       1.      Open the View Designer for the ResultView again.

       2.      Choose the Context tab.

       3.      Open the context menu for the root node  Context and choose the option New ® Model Node.

       4.      Enter the name FlightList for the model node and choose Finish.

       5.      From the context menu of the model node that you have created, choose Edit Context Mapping

       6.      Expand the custom context structure Bapi_Flight_Getlist_Input ® Output, then choose Next.  

       7.      Choose the node Flight_List, then choose Finish.

The Developer Studio refreshes the view context tree appropriately.

       8.      Save your work by choosing the icon  (Save All Metadata) from the toolbar

Result

You have created the necessary view contexts and mapped them to the component context you created previously. You are now in a position to bind UI controls in the two views to the corresponding view context elements.

Next step:

Creating Actions and Declaring Methods