- 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
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).
// 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, ",")
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 laterMode 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. | paramNoDecoding | The 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 21Mode 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. | paramNoDecoding | The 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. | paramNoDecoding | The 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 New in version 16Remarks 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 "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 subscriptThe subscript of the parameter corresponds to the order in which the parameters were passed in the URL of the page.
1. Code used to display the page by passing parameters:
// In the "MyPage.AWP" page, displays the 350th element // of "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)
Versions 20 and laterPre-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 20Pre-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 New in version 21
Related Examples:
|
Training (WEBDEV): WW_Organizer
[ + ] The WW_Organizer example is an example for using the Organizer control of WEBDEV.
|
Component : wd260page.dll
|
|
|
| |
| 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. |
|
|
|
| |
| |
| |
| |
| |
| |
| | |
|