NaturalONE Version 8.3.7
 —  Natural for Ajax  —

XCICONTEXT

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

The following topics are covered below:


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 Mangement).

Top of page

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.

Top of page

Properties

Basic
contextprop

Name of the adapter parameter that provides the content of the control.

Optional  
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 for a generated statusprop variable to which field the statusprop belongs.

Optional  

Top of page