Entering content frame

Procedure documentation Defining the View of the Target Application Locate the document in its SAP Library structure

The properties in the start application are displayed in the view of Web Dynpro component PageNavigationTargetComp (see screenshot).

This graphic is explained in the accompanying text

The entries in start application StartNavigationApp are passed as URL parameters when the target application TargetNavigationApp is called, and read out with Web Dynpro runtime service WDWebContextAdapter.

The required developmental steps are described below:

·        Build view TargetView

·        Build the context of the view.

·        Bind the data of the user interface element properties to the context structure defined at design time.

·        Implement a controller

Prerequisites

To edit the view, you must have created the described parts in the Project Structure. This includes creating

·        Web Dynpro project PageNavigationProject

·        Web Dynpro component PageNavigationTargetComp

·        View TargetView.

You then navigate to directory Views in the project structure in the Web Dynpro Explorer and perform the described steps.

For a detailed description of the procedure for creating Web Dynpro projects, Web Dynpro components, the context structure, and the layout of the view, see Creating Your First Web Dynpro Application.

Procedure

Creating a Layout

You navigate to directory Views in the project structure in the Web Dynpro Explorer. With the secondary mouse button, you select the view you created for editing.

For a detailed description of how to create the layout of a view, see Creating and Designing a View.

...

       1.      Delete the UI element DefaultTextView that was automatically generated with the view.

       2.      Add group UI element Group1.

       3.      Add caption UI element Group1_Header for labeling the group user interface element.

       4.      Add text view UI element TextView1.

       5.      Add input field InputField2.

       6.      Add input field InputField3.

 

Bildschirmkopie zum Aufbau der View:

This graphic is explained in the accompanying text

...

Creating the Context Structure

You must define the corresponding context attributes in order to store input field entries in the context of the view. If you bind the property value of the input fields to these context attributes, the data is retained as long as the view is needed.

For a detailed description of how to create a context structure at design time, see the tutorial for Context Programming and Data Binding and Declaring the Controller Context of a View.

       1.      Create context attribute FirstName of type String as the root node attribute

       2.      Create context attribute LastName of type String as the root node attribute

This graphic is explained in the accompanying text

Defining Data Binding of the User Interface Element Properties

Property value of UI element InputField2 is bound to context attribute FirstName.

This graphic is explained in the accompanying text

Property value of UI element InputField3 is bound to context attribute LastName.

This graphic is explained in the accompanying text

 

Implementing a Controller

With the Web Dynpro runtime service WDWeb ContextAdapter, you can access the URL parameters that were passed by the start application and set the corresponding context attributes to these values.

//@@begin javadoc:wdDoInit()

  /** Hook method called to initialize controller. */

  //@@end

  public void wdDoInit()

  {

    //@@begin wdDoInit()

String Name = WDWebContextAdapter.getWebContextAdapter().getRequestParameter("firstName");

String Name2 = WDWebContextAdapter.getWebContextAdapter().getRequestParameter("lastName");

wdContext().currentContextElement().setFirstName(Name);

wdContext().currentContextElement().setLastName(Name2);

    //@@end

  }

 

Result

You created a view that is used as navigation target and that displays the URL parameters of the start application.

This graphic is explained in the accompanying text Next step:

Building, Deploying, and Running the Project

  

  


 

 

Leaving content frame