PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Retrieving a value that is not linked to a control
  • Retrieving the parameters passed to an AWP or PHP page
  • Example of URL used to run a WEBDEV site by passing parameters
  • Retrieving the parameters sent to the page from a WINDEV or WINDEV Mobile application
  • Pre-launched sessions
  • PHP4
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
PageParameter (Function)
In french: PageParamètre
Returns the value of a parameter passed to the current page. Used to retrieve:
  • the parameters of a command line.
  • a value that is not linked to a control (position of the mouse in a clickable image).
// Code d'initialisation du projet
SWITCH Upper(PageParameter("PAGEDEMARRAGE"))
CASE "LOGIN": PageDisplay(PAGE_Identification)
CASE "PRODUITS": PageDisplay(PAGE_GestProd)
OTHER CASE: // Ne rien faire
END
// Récupération de la position de la souris dans une image cliquable
Paramètre is string = PageParameter("POS")
// Ex: Paramètre ="15,23"
x,y are int
x = ExtractString(Paramètre, 1, ",")
y = ExtractString(Paramètre, 2, ",")
WEBDEV - Server codeAjax
// Récupération de la position de la souris dans une image cliquable
Paramètre is string = PageParameter(1)
// Ex: Paramètre = "POS=15,23"
Syntax

Retrieving the value of a parameter identified by its name Hide the details

<Result> = PageParameter(<Parameter name> [, <Encoding>])
<Result>: Character string
  • Value of specified parameter,
  • Empty string ("") if the parameter does not exist or if it has no value.
<Parameter name>: Character string
Name of the parameter whose value must be returned. For an Active WEBDEV Page, the parameters are automatically named by WEBDEV (P1, P2, ..., P256). In this case, no controls named P1, P2, ..., P256 must be found in the page.
<Encoding>: Optional Integer constant
Versions 21 and later
Mode for managing the encoding of parameter value:
paramWithDecoding
(Default value)
The parameter value is automatically decoded by WEBDEV according to the encoding/decoding standard of URLs.
paramNoDecodingThe raw value of the parameter is returned. No decoding is performed by WEBDEV. This constant can be used when the URL encoding does not respect the standard used by WEBDEV (problem for managing the + sign, etc.)
New in version 21
Mode for managing the encoding of parameter value:
paramWithDecoding
(Default value)
The parameter value is automatically decoded by WEBDEV according to the encoding/decoding standard of URLs.
paramNoDecodingThe raw value of the parameter is returned. No decoding is performed by WEBDEV. This constant can be used when the URL encoding does not respect the standard used by WEBDEV (problem for managing the + sign, etc.)
Mode for managing the encoding of parameter value:
paramWithDecoding
(Default value)
The parameter value is automatically decoded by WEBDEV according to the encoding/decoding standard of URLs.
paramNoDecodingThe raw value of the parameter is returned. No decoding is performed by WEBDEV. This constant can be used when the URL encoding does not respect the standard used by WEBDEV (problem for managing the + sign, etc.)
WEBDEV - Server codeAjax

Retrieving the value of a parameter identified by its index Hide the details

<Result> = PageParameter(<Parameter index> [, <Encoding>])
<Result>: Character string
  • Value of specified parameter. This value has the following format: <Parameter name> = <Value>.
  • Empty string ("") if the parameter does not exist.
<Parameter index>: Integer
Index of the parameter whose value must be returned.
<Encoding>: Optional Integer constant
Versions 21 and later
Mode for managing the encoding of parameter value:
paramWithDecoding
(Default value)
The parameter value is automatically decoded by WEBDEV according to the encoding/decoding standard of URLs.
paramNoDecodingThe raw value of the parameter is returned. No decoding is performed by WEBDEV. This constant can be used when the URL encoding does not respect the standard used by WEBDEV (problem for managing the + sign, etc.)
New in version 21
Mode for managing the encoding of parameter value:
paramWithDecoding
(Default value)
The parameter value is automatically decoded by WEBDEV according to the encoding/decoding standard of URLs.
paramNoDecodingThe raw value of the parameter is returned. No decoding is performed by WEBDEV. This constant can be used when the URL encoding does not respect the standard used by WEBDEV (problem for managing the + sign, etc.)
Mode for managing the encoding of parameter value:
paramWithDecoding
(Default value)
The parameter value is automatically decoded by WEBDEV according to the encoding/decoding standard of URLs.
paramNoDecodingThe raw value of the parameter is returned. No decoding is performed by WEBDEV. This constant can be used when the URL encoding does not respect the standard used by WEBDEV (problem for managing the + sign, etc.)
Versions 16 and later
WEBDEV - Server codeAjax

Retrieving specific data Hide the details

<Result> = PageParameter(<Type of message>)
<Result>: Character string
  • Data sent by HTTPRequest.
  • Empty string ("") if no data.
<Type of message>: Integer constant
Type of data to retrieve:
paramBufferRetrieves the rough data that was received (sent by a POST method). The data received must use one of the following MIME types:
  • "application/octet-stream".
  • "text/xml".
Remark: If this constant is used, the page can be tested only by using the HTTPRequest function to transmit the. A simple GO of the page does not work.
New in version 16
WEBDEV - Server codeAjax

Retrieving specific data Hide the details

<Result> = PageParameter(<Type of message>)
<Result>: Character string
  • Data sent by HTTPRequest.
  • Empty string ("") if no data.
<Type of message>: Integer constant
Type of data to retrieve:
paramBufferRetrieves the rough data that was received (sent by a POST method). The data received must use one of the following MIME types:
  • "application/octet-stream".
  • "text/xml".
Remark: If this constant is used, the page can be tested only by using the HTTPRequest function to transmit the. A simple GO of the page does not work.
WEBDEV - Server codeAjax

Retrieving specific data Hide the details

<Result> = PageParameter(<Type of message>)
<Result>: Character string
  • Data sent by HTTPRequest.
  • Empty string ("") if no data.
<Type of message>: Integer constant
Type of data to retrieve:
paramBufferRetrieves the rough data that was received (sent by a POST method). The data received must use one of the following MIME types:
  • "application/octet-stream".
  • "text/xml".
Remark: If this constant is used, the page can be tested only by using the HTTPRequest function to transmit the. A simple GO of the page does not work.
Remarks

Retrieving a value that is not linked to a control

By default, the parameters sent by the browser are usually assigned to the controls found in the context, before any process is run. The PageParameter function allows you to obtain a value that is not linked to an control.
Example: The PageParameter function is used to retrieve a position in a clickable Image.
For the click areas, during a mouse click, you have the ability to retrieve the horizontal and vertical position of the mouse in the click area via a specific parameter: "POS" (see the example).

Retrieving the parameters passed to an AWP or PHP page

The PageParameter function is used to retrieve the value of the parameters passed to the. Several possibilities exist according to the type of page:
  • Retrieval according to the name of the parameter
  • Retrieval according to the parameter index
Case 1: Retrieval according to the parameter name
The name of the parameter was specified in the URL of the page.
For an AWP or PHP page, the parameters are automatically renamed by WEBDEV (P1, P2, ..., P256). In this case, no controls named P1, P2, ..., P256 must be found in the page.
1. Code used to display the page by passing parameters:
// Affiche dans la page "MaPage.AWP", le 350ème élément
// de la catégorie "Instruments"
PageDisplay(PAGE_MaPage, "Instruments", 350)
2. Code used to retrieve the parameters:
// Récupération des paramètres
CategorieRecherchée is string = PageParameter("P1")
IDRecherché is int = PageParameter("P2")


Case 2: Retrieval according to the parameter index
The parameter index corresponds to the order in which the parameters were passed in the page URL.
PHP This syntax is not available in this version.
1. Code used to display the page by passing parameters:
// Affiche dans la page "MaPage.AWP", le 350ème élément
// de la catégorie "Instruments"
PageDisplay(PAGE_MaPage, "Instruments", 350)
2. Code used to retrieve the parameters:
// Récupération des paramètres
CategorieRecherchée is string = PageParameter(1)
// CategorieRecherchée = "P1=Instruments"
CategorieRecherchée = Right(Length(CategorieRecherchée)-3)
IDRecherché is int = PageParameter(2)
// IDRecherché = "P2=350"
IDRecherché = Right(Length(IDRecherché)-3)
WEBDEV - Server codeAjax

Example of URL used to run a WEBDEV site by passing parameters

http://Serveur/WD260AWP/WD260AWP.EXE/CONNECT/APPLI?PARAM1=VAL1&PARAM2=VAL2&PARAM3=VAL3
In this code:
  • server corresponds to the server address,
  • APP corresponds to the name of the WEBDEV site,
  • PARAM1, PARAM2 and PARAM3 correspond to the names of the parameters,
  • VAL1, VAL2 and VAL3 correspond to the values of the different parameters.
Each parameter is retrieved in WLanguage, in the initialization code of the project. For each parameter, it is sufficient to use the PageParameter function by specifying the name of the parameter to retrieve.
For example:
// Récupération du paramètre ayant pour nom PARAM1
PageParameter("PARAM1")
WEBDEV - Server codeAjax

Retrieving the parameters sent to the page from a WINDEV or WINDEV Mobile application

If the value of a received parameter was sent by a WINDEV or WINDEV Mobile application with HTTPRequest and if it was encoded by URLEncode, there is no need to decode this value. PageParameter will automatically perform the decode operation (call to URLDecode).
Versions 20 and later

Pre-launched sessions

If your project uses pre-launched sessions, this function must not be used in the "Initializing" event of the project. This function must be used in the event "Initializing the project after connection to the site".
New in version 20

Pre-launched sessions

If your project uses pre-launched sessions, this function must not be used in the "Initializing" event of the project. This function must be used in the event "Initializing the project after connection to the site".

Pre-launched sessions

If your project uses pre-launched sessions, this function must not be used in the "Initializing" event of the project. This function must be used in the event "Initializing the project after connection to the site".
Versions 21 and later
PHP

PHP4

In PHP4, to retrieve the rough value of parameters (paramBuffer constant or paramNoDecoding constant), the "always_populate_raw_post_data" directive must be set to "on" in the configuration file of PHP (php.ini file).
New in version 21
PHP

PHP4

In PHP4, to retrieve the rough value of parameters (paramBuffer constant or paramNoDecoding constant), the "always_populate_raw_post_data" directive must be set to "on" in the configuration file of PHP (php.ini file).
PHP

PHP4

In PHP4, to retrieve the rough value of parameters (paramBuffer constant or paramNoDecoding constant), the "always_populate_raw_post_data" directive must be set to "on" in the configuration file of PHP (php.ini file).
Related Examples:
WW_Organizer Training (WEBDEV): WW_Organizer
[ + ] The WW_Organizer example is an example for using the Organizer control of WEBDEV.
Component: wd270page.dll
Minimum version required
  • Version 9
Comments
Click [Add] to post a comment