PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • 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
  • Cached sessions
  • PHP4
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
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).
// Initialization code of project
SWITCH Upper(PageParameter("HOMEPAGE"))
CASE "LOGIN": PageDisplay(PAGE_Identification)
CASE "PRODUCTS": PageDisplay(PAGE_ProdMgt)
OTHER CASE: // No action
END
// Retrieve the position of the mouse in a clickable image
Parameter is string = PageParameter("POS")
// Ex: Parameter ="15,23"
x,y are int
x = ExtractString(Parameter, 1, ",")
y = ExtractString(Parameter, 2, ",")
WEBDEV - Server codeAjax
// Retrieve the position of the mouse in a clickable image
Parameter is string = PageParameter(1)
// Ex: Parameter = "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 (with quotes)
Name of the parameter whose value must be returned. For an AWP 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 rough parameter value 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, ...)
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 rough parameter value 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, ...)
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 rough parameter value 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, ...)
WEBDEV - Server codeAjax

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

<Result> = PageParameter(<Parameter Subscript> [, <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 Subscript>: Integer
Subscript 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 rough parameter value 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, ...)
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 rough parameter value 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, ...)
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 rough parameter value 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, ...)
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".
Note: If this constant is used, the test of the page can only be run by using HTTPRequest to transmit the message. A simple GO of the page does not operate.
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".
Note: If this constant is used, the test of the page can only be run by using HTTPRequest to transmit the message. A simple GO of the page does not operate.
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".
Note: If this constant is used, the test of the page can only be run by using HTTPRequest to transmit the message. A simple GO of the page does not operate.
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. PageParameter is used to retrieve a value that is not linked to a control.
Example: PageParameter 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

PageParameter is used to retrieve the value of the parameters passed to the page. Several possibilities exist according to the type of page:
  • Retrieval according to the name of the parameter
  • Retrieval according to the subscript of the parameter
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:
// In the "MyPage.AWP" page, displays the 350th element
// of the "Instruments" category
PageDisplay(PAGE_MyPage, "Instruments", 350)
2. Code used to retrieve the parameters:
// Retrieve the parameters
SoughtCategory is string = PageParameter("P1")
SoughtID is int = PageParameter("P2")
Case 2: Retrieval according to the parameter subscript
The subscript of the parameter corresponds to the order in which the parameters were passed in the URL of the page.
PHP This syntax is not available in this version.
1. Code used to display the page by passing parameters:
// In the "MyPage.AWP" page, displays the 350th element
// of the "Instruments" category
PageDisplay(PAGE_MyPage, "Instruments", 350)
2. Code used to retrieve the parameters:
// Retrieve the parameters
SoughtCategory is string = PageParameter(1)
// SoughtCategory = "P1=Instruments"
SoughtCategory = Right(Length(SoughtCategory)-3)
SoughtID is int = PageParameter(2)
// SoughtID = "P2=350"
SoughtID = Right(Length(SoughtID)-3)
WEBDEV - Server codeAjax

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

http://Server/WD220AWP/WD220AWP.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, use PageParameter and specify the name of the parameter to retrieve.
For example:
// Retrieve the parameter named 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

Cached sessions

If your project is using cached sessions, this function must not be used in the "Initializing the project" process. This function must be used in the "Initializing the project after connection to the site" process.
New in version 20

Cached sessions

If your project is using cached sessions, this function must not be used in the "Initializing the project" process. This function must be used in the "Initializing the project after connection to the site" process.

Cached sessions

If your project is using cached sessions, this function must not be used in the "Initializing the project" process. This function must be used in the "Initializing the project after connection to the site" process.
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_Agenda example is an example for using the Organizer control of WEBDEV.
Components
WEBDEV - Server code wd230page.dll
Linux wd230page.so
Minimum required version
  • Version 9
Comments
Documentation Issue with paramBuffer Constant
It says that to use the paramBuffer constant, you have to use MIME types application/byte-stream or text/xml

However application/byte-stream is not a proper MIME type it should be application/octet-stream, the French help page has it correctly

I suspect it was just accidentally translated in the English Page

Note if you try application/byte-stream, the PageParameter function fails causing a runtime error saying the Query is empty.
Pete
Dec. 15 2016