Show TOC

Background documentationData Binding and Mapping Locate this document in the navigation structure

 

Within the Web Dynpro architecture, the contexts of the different controllers can be linked in different ways:

  • A UI element of the user interface of the view can be linked with an element of the view context.

  • A mapping can be defined between two global controller contexts, or from a view context to a global controller context.

  • The context of a global controller can be linked to a Web Dynpro Model.

This graphic is explained in the accompanying text.

Defining Mapping Between Two Contexts

The elements of a view context can be locally defined. In this case (represented in the graphic below as a local node), all the contained attributes are only visible within the relevant view. When the view disappears, the attribute values are deleted.

This graphic is explained in the accompanying text.

A second option for defining context elements is to link a context node to a node of another context. The graphic above represents the definition of a mapping between the node Node 1 from the context of View1, and the node of the same name in the context of the component controller. Also displayed is a mapping from the node Node 2 from the context of View2, also to a node with the same name in the component controller context. The global context of the component controller is visible for both view controllers, and all the controllers involved have both read and write access to the contained attributes. The values for the attributes of the component controller context are contained here as long as the user does not exit the component. The values are still available even if the view that you used last is no longer displayed on the screen. It is therefore possible to transport data across different contexts within a component. A data value that, for example, has been read from an InputField of the first view, can be forwarded to the context of the component controller using a suitable mapping. The value then still exists in the memory if the navigation has already led to the next view. If a corresponding mapping is already defined for the successive view, the view can then process this value.

This graphic is explained in the accompanying text.

If the value is then changed in the second view, any subsequent views for which a similar mapping is defined then find the current value in their context.

Note Note

All global controller contexts (visible component-wide) can be linked to each other. A mapping can also be defined from a view context element to an element of a global context. But it is not possible to define a mapping in the other direction - from a global context element to a view context element, since the lifetime of the view context is shorter than that of the global controller context.

End of the note.
Binding a UI Element to a Context Attribute

Properties of the user interface elements contained in the view can be bound to attributes of a view context. This enables the context data to be displayed in the browser. Any user changes to the view displayed in the browser are stored in the context. Multiple properties can be bound to one context element.

This graphic is explained in the accompanying text.

Within a context, all elementary data types are available for the definition of attributes. The information stored here is also used by a Web Dynpro application for creating value help, and for creating error messages if invalid entries are made.

Defining a Binding to a Web Dynpro Model

You can also define a binding between the context of a component controller and the data of a Web Dynpro model.