XCICONTEXT

#### Search Results

Search

# XCICONTEXT

The XCICONTEXT control can be used to exchange simple data values between different pages of an application. Example usage scenarios are:

- Share simple data between a page and an embedded page (see also SUBCISPAGE2 control). The pages can share, for instance, a key value for the currently selected article. The embedded page shows details based on this key.

- Workplace scenarios in which multiple pages need to share some simple data.

The following topics are covered below:

- General Information

- Example

- Properties

## General Information

The XCICONTEXT control can hold multiple XCICONTEXTPARAM controls. Each of the XCICONTEXTPARAM controls defines a name and a value. At runtime, these names and values are automatically shared between all pages running in the same session.

The Natural applications change and access the corresponding data fields in the usual way. No additional coding is required for the data exchange - this is automatically done by the framework. Internally, the framework uses the session context (for more information on the session context, see the section Saving Context Data in the Application Designer documentation; this can be found under Special Development Topics > Details on Session Management).

## Example

The example showing the SUBCISPAGE2 control in the Natural for Ajax demos also shows how to use the XCICONTEXT control. In the layouts of all pages that are to share a specific data value, a corresponding XCICONTEXTPARAM with the same name has been defined. In the example below, the pages share the value for the "selectedArticle":

    <xcicontext contextprop="mycontext">
      <xcicontextparam valueprop="selectedArticle" lookupname="selectedArticle">
      </xcicontextparam>
    </xcicontext>

The generated data Natural data structure looks as follows:

    1 MYCONTEXT
    2 SELECTEDARTICLE (A) DYNAMIC

The Natural applications can now access the `SELECTEDARTICLE` field in the usual way.

## Properties

Natural
njx:natname | If a Natural variable with a name not valid for Application Designer (for instance #FIELD1) shall be bound to the control, a different name (for instance HFIELD1) can be bound instead. If the original name (in this case #FIELD1) is then specified in this attribute, the original name is generated into the parameter data area of the Natural adapter and a mapping between the two names is generated into the PROCESS PAGE statement of the Natural adapter. This mapping must not break a once defined group structure. If for instance a grid control that is bound to a name of GRID1 contains fields that are bound to FIELD1 and FIELD2 respectively, the corresponding njx:natname values may be #GRID1.#FIELD1 and #GRID1.#FIELD2, but not #GRID1.#FIELD1 and #MYGRID1.#FIELD2. | Optional |
njx:natcomment | The value of this attribute is generated as comment line into the parameter data area of the Natural adapter, before the field name. The Map Converter, for instance, uses this attributes to indicate a generated statusprop variable to which field the statusprop belongs. | Optional |

### On this page

- General Information
- Example
- Properties