Show TOC Start of Content Area

Procedure documentation Creating the Controller Context  Locate the document in its SAP Library structure

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 editor from within the graphical tool, double-click the component WelcomeComp in the component modeler and then ComponentContoller.

Alternatively, you can use the project structure and expand the node Web Dynpro Components WelcomeComp, and then double-click the  This graphic is explained in the accompanying text Component Controller node.

       2.      In the editor that appears, choose the Context tab.

       3.      Open the context menu for the root node Context and choose the option New Node 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 Properties view, set the Collection Cardinality to 1…n. This is necessary 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 New Attribute.

       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.

This graphic is explained in the accompanying text

 

End of Content Area