Show TOC

Step 1: Creating and Editing a ComponentLocate this document in the navigation structure

Procedure

In this step you first create a new Component .

Create a Component.

  1. To do this, call the Object Navigator and choose Web Dynpro Comp./Intf in the object list.

  2. Enter a new name for the component, for example, MYCOMPONENT , and choose Display .

    Note

    Note that the selection of the component name by namespace and naming conventions is limited. The initial letters "Y" and "Z" are reserved for customers.

    Choose a different name for your component if an object already exists for the name that you selected.

  3. Confirm the prompt asking you if you want to create the object.

  4. Enter a short text for your component, and select type Web Dynpro Component .

    The newly created component was automatically equipped with a few elements, for example, the component Controller , an initial View MAIN, and the main Window , in which the MAIN view was already embedded, were created.

    The Context of the component controller will be visible for all views of this component, although it is currently empty.

  5. Confirm the create dialog box with Close (Enter).

  6. Save the new component as a local object (package $TMP).

Edit New component

  1. Now double-click on the COMPONENTCONTROLLER object of your new component.

    The Context tab of the controller is displayed. You can now define a context.

    Make sure that the Workbench is in change mode.

  2. Select the root node CONTEXT , and choose Start of the navigation path Create Next navigation step Node End of the navigation path in the context menu.

  3. Enter a name for the new node (such as NODE1 ) and confirm the dialog box with continue (Enter), without worrying about the other criteria.

    The new node appears below the root node. You can now create an attribute for this node.

  4. Select the new context node and choose Start of the navigation path Create Next navigation step Attribute End of the navigation path in the context menu.

  5. Enter a name for the attribute (such as MYNAME ) and in the same window, specify the Type of the attribute with STRING.

  6. Confirm the dialog box with Continue, without worrying about the other criteria.

  7. Save your entries.

At the end of the first step, you should have created the two required views. In principle, you could already include the MAIN view in your layout, but for ease of clarity in this procedure, the two required views are created additionally.

  1. Open the context menu of your component and choose Start of the navigation path Create Next navigation step View End of the navigation path.

  2. Give the first view a name (such as STARTVIEW ) and confirm the window.

    Alternatively, you can use the MAIN view created automatically when you created the component, and rename it.

    As soon as you have saved your work, the Views node is inserted in the hierarchy of the object list below the component, and the STARTVIEW you have just created is stored there.

  3. Open the context menu of the Views node and choose Create to add a second view.

  4. Enter a name for the second view (such as RESULTVIEW ) and confirm the creation process again.

  5. Save your entries.

Figure 1: Component
Result

The component you have created has a component controller, in whose context the MYNAME attribute was stored. This attribute is visible for each view of this component and can be changed by all controllers of the component. The component now also contains two views.

Continue with Step 2: Structuring the First View .