Tips & Tricks - WriteContainer - Read value from session

This workshop demonstrates how values of a WriteContainer can be written to a session and then read in another WriteContainer. You can download the sample application here and then import it as usual.

In the application, a value can be entered in the "write-session" input field on the input page. This value is written to the session by a correspondingly configured WriteContainer when saving and entered in "Title" by a second WriteContainer.

Elements on the edit page

On the input page of the sample application, you will find the input field "write-session", the content of which is to be written to the session.

The edit field is linked to a data field. All other elements on the input page are those that are automatically created when you create an application with the basic application template.

WriteContainer "WRITE_SESSION"

To write the value of the input field "write-Session" to the session, a WriteContainer with the name "WRITE_SESSION", the type "User-defined" and the user-defined class "Session" was created. This WriteContainer is first in the order of the WriteContainers. Nothing needs to be defined in the filter criteria of the WriteContainer in this example.

The source "control", the control "write-session" and the target session variable "my_session_var" are defined in the bindings.

WriteContainer "WRITE_XDATAGROUP00D1A218"

The second WriteContainer is the standard WriteContainer that is automatically created when you create an application with the basic application template. The settings under ""Properties"" and ""Criteria"" can be left as they are in this case.

You will find two entries under ""Bindings"" of the second WriteContainer.

The first binding reads the session variable and writes it to the "Title". The settings here are: source "Session", session "my_session_var" (name of the session variable), target "Title" (data field that is linked to the "Title" input field on the input page).

The second binding ensures that the session value is also stored in the "write-session" data field. Here the settings are: source "control", control "write-session" (name of the input field), target "write-session" (data field that is linked to the input field "write-session" on the input page).

OK" button

In the properties of the "OK" button, the WriteContainer "WRITE_SESSION" now only needs to be added on the "Actions" tab.