Show TOC

 IF_WD_CONTEXT_ELEMENTLocate this document in the navigation structure

Interface IF_WD_CONTEXT_ELEMENT enables a single context element to be filled or data to be fetched from a context element.

Most of the methods of this interface are also contained in IF_WD_CONTEXT_NODE . These are then used on the element of the lead selection, or on an element with the specified index.

Methods

GET_ATTRIBUTE

Method to get the values of a context attribute.

The prerequisite for this method is that the application knows the data type of the attribute.

The value of the given attribute is copied to the export parameter. To do this the export parameter must have a data type to which a value can be written.

If the attribute name is <attr_name>:NOT,  it is assumed that the value is Boolean and the inverted value is written.

If the attribute name is <attr_name>:FINAL, the system checks whether the attribute value was set to final, and writes this information.

If the attribute does not exist or the value cannot be written, an exception of type CX_WD_CONTEXT is triggered.

Note

If the values of several declared attributes of an element can be retrieved, it is usually more efficient to use method GET_STATIC_ATTRIBUTE.

GET_ATTRIBUTE_REF

This method is similar to GET_ATTRIBUTE, but it is different in the following ways:

  • A return parameter is used instead of an export parameter, and this contains a reference to data with the value of the attribute.
  • The reference is not the reference to the value stored internally. Data with the correct type is created, the value is copied to it, and then the reference to the newly created data is output.

GET_INDEX

The index of the current element is returned.

GET_CHILD_NODE

This method returns the reference to a child node with the specified name. child nodes Child nodes are created always by the framework, and not be the application.

Note

For performance reasons always specify the name of the child node in upper case.

GET_CHILD_NODES

This method returns all child nodes of this one element as a table containing pairs of names and references.

GET_NODE

This method returns the reference to the node belonging to the element. If the element is not valid, an exception (of type CX_WD_CONTEXT) is triggered. The validity of the element is therefore identified.

GET_STATIC_ATTRIBUTES

This method copies the static attributes to the transferred variable. If the structure is not identical, a move-correspondingis performed, which is not as efficient as a direct move, but is still useful in many cases.

Static attributes are those that either have been declared or that belong to the structure with which the node was declared.

GET_PATH

This method returns the path of the element in the controller in which the original node is declared (that is, not in the controllers that have declared a mapping).

You can specify that the controller name is contained in the path or not (see also IF_WD_CONTEXT_NODE =>GET_PATH).

If the path is to be searched for in a specific controller (for instance, as a binding path in a view), the method CL_WD_CONTEXT_SERVICES=>GET_ELEMENT_PATH_FOR_CTRL must be used, whereby this procedure reduces system performance.

GET_STATIC_ATTRIBUTES_REF

Behaves with GET_STATIC_ATTRIBUTES as GET_ATTRIBUTE_REF does with GET_ATTRIBUTE.

IS_ALIVE

Method for checking whether the associated controller is still "alive", which means it can still be accessed, and has not been terminated with WDDOEXIT.

IS_CHANGED_BY_CLIENT

Indicates whether the context element was changed by the user.

Note

We recommend that you use the context change log instead.

SET_CHANGED_BY_CLIENT

Behaves as if an element was changed by the user (see also Context Change Log ).

SET_ATTRIBUTE

Sets the value of an attribute to the same name.

Note

If several statically declared attributes are to be changes, we recommend you use  SET_STATIC_ATTRIBUTES.

SET_ATTRIBUTE_NULL

An attribute that was set to NULL is always displayed empty. This makes it possible to distinguish between an empty content and the initial value.

SET_STATIC_ATTRIBUTES

Sets all statically declared attributes. If you do not transfer anything, the initial values are set. If the structure does not fit exactly, move-corresponding is performed.

SET_STATIC_ATTRIBUTES_NULL

Sets all attributes to the special NULL value (see also SET_ATTRIBUTE_NULL)

SET_FINALIZED

An element set to final is not allowed to be changed by the user or by the application. The final setting cannot be undone. But you can still delete the element.

SET_ATTRIBUTE_FINALIZED

Only an attribute is set to final.

IS_FINALIZED

IS_ATTRIBUTE_FINALIZED

TO_XML

Serializes the attributes of this element as XML.

IS_SELECTED

Ascertains whether this element is selected (whereby this must not mean the lead selection).

IS_ATTRIBUTE_NULL

SET_SELECTED

Selects the element