Show TOC

Creating the Controller ContextLocate this document in the navigation structure

Use

Each Web Dynpro component is supplied with a corresponding component controller. It serves as a global controller that is visible within the Web Dynpro component for all other controllers, especially for the view controllers. The data used in the Web Dynpro component or in the view is stored in the context. Read-write access to this data is available using the controllers as a starting point.

Procedure

You start by creating a global data storage space using the component context.

Creating a context for the component controller

  1. To navigate to the component controller, double-click on the component WelcomeComp in the Web Dynpro Explorer component modeler and then click on ComponentContoller in the component modeler.

    Alternatively, you can navigate to the node Start of the navigation path Web Dynpro Next navigation step Components  Next navigation step  WelcomeComp, End of the navigation path and then double-click the Component Controller node.

  2. In the properties view, choose the Context tab.

  3. Open the context menu for the root node Context and choose the option Start of the navigation path New Next navigation step  Node  End of the navigation path and in the next screen Manually (since you need to create the context from scratch) .

  4. Enter a name for the Node, for example userNode and confirm with Finish.

  5. In the Propertiessection of the context tab, set the Collection Cardinality 1...n to . This is necessary such that at runtime at least one node element is created and the InputField is enabled to accept the user's input.

  6. Select the userNode , open the context menu and choose Start of the navigation path New Next navigation step Attribute End of the navigation path.

  7. Select the option Manually enter the name username and select string as the type of the attribute. Then choose Finish . The value attribute is added to the context node userNode .