PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • If the management mode of contexts via cookies is used (ctxCookie constant used in ConfigureAWPContext):
  • If the management mode of contexts on disk is used (ctxDisk constant used in ConfigureAWPContext):
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Allows you to declare a list of variables whose value will be persistent between the successive displays of AWP pages. This function indicates the variables that will be saved and restored whenever the AWP pages are displayed. This allows you to manage an AWP context. Two modes are available for managing the contexts:
  • Managing the contexts via cookies (by default).
  • Managing the contexts on disk.
The mode for managing the contexts is selected in ConfigureAWPContext. If this function is not called, the default management mode of contexts is the management of contexts via cookies.
DeclareAWPContext is taken into account in AWP mode only.
This function should be used in the event "Initializing" of the project (for the project variables) and/or in the event "Initializing" of the pages (for the page variables). In most cases, this function must be used in the process where the variables are declared and initialized.
Versions 20 and later
If your project is using pre-launched sessions, this function must not be used in the project "Initializing" event. This function must be used in the event "Initializing the project after connection to the site".
New in version 20
If your project is using pre-launched sessions, this function must not be used in the project "Initializing" event. This function must be used in the event "Initializing the project after connection to the site".
If your project is using pre-launched sessions, this function must not be used in the project "Initializing" event. This function must be used in the event "Initializing the project after connection to the site".
Note: For more details:
Caution: This function requires a good knowledge of WEBDEV.
Example
// -- Initialization code of project
gnNumCurrentProduct is int = 1

// Indicate that the value of gnNumCurrentProduct must be saved
// whenever an AWP page is displayed
DeclareAWPContext(gnNumCurrentProduct)

// During the next displays of the page:
// - either the value of gnNumCurrentProduct is not retrieved
// and it is automatically reinitialized with "1"
// (during the first page display for example)
// - or the value of gnNumCurrentProduct is retrieved and used
// (during the next displays for example)
Syntax
<Result> = DeclareAWPContext(<Name of variable 1> [, <Name of variable 2> [... [, <Name of variable N>]]])
<Result>: Boolean
  • True if the specified variables have been restored,
  • False otherwise (during the first page display for example).
<Name of variable 1>: Type of variable
Name of first variable that will be saved at the end of display. The value of this variable will be retrieved during the successive page displays.
<Name of variable 2>: Type of variable (optional parameter)
Name of 2nd variable that will be saved at the end of display. The value of this variable will be retrieved during the successive page displays.
<Name of variable N>: Type of variable (optional parameter)
Name of Nth variable that will be saved at the end of display. The value of this variable will be retrieved during the successive page displays.
Remarks

If the management mode of contexts via cookies is used (ctxCookie constant used in ConfigureAWPContext):

  • DeclareAWPContext is using the HTTP cookies. The values of variables will not be restored if the HTTP cookies are ignored by the browser used on the current computer.
  • The total size of values for the different variables cannot exceed 4KB. If the size of these values is too important, these values will be truncated (missing variable and/or truncated content).
  • DeclareAWPContext is not recommended for the sensitive data (user password for example). Indeed, the data flows via the browser. This function must NOT be used to store a user connection for example.
  • If two variables are saved with the same name (one in the project and the other one in a page for example), only the first variable will be stored.
  • DeclareAWPContext returns False if one of the variables was not restored.
  • Only the variables passed to DeclareAWPContext during a page display will be retrieved during the next display. The variables that were previously passed are not automatically saved again.
  • Only the simple variables (integer, string, ...) are supported.

If the management mode of contexts on disk is used (ctxDisk constant used in ConfigureAWPContext):

  • DeclareAWPContext is using the contexts on disk. The values of variables are always restored.
  • The total size of values for the different variables is not limited.
  • DeclareAWPContext can be used for sensitive data (user password, for example).
  • If two variables are saved with the same name (one in the project and the other one in a page for example), the two variables are stored independently.
  • DeclareAWPContext returns False if one of the variables was not restored.
  • All variables passed to DeclareAWPContext during a page display can be retrieved during the next display. The variables that were passed beforehand are automatically saved again.
  • The simple variables (integer, string, ...) are supported as well as the structure, class, array or associative array variables. Fixed arrays, global members of classes and associative arrays of local structures are not supported.
Component : wd250page.dll
Minimum version required
  • Version 10
Comments
Click [Add] to post a comment