|
|
|
|
- Overview
- Displaying an Active WEBDEV Page without parameters
- Displaying an Active WEBDEV Page from a WEBDEV page
- Displaying an Active WEBDEV Page in a browser or from any site
- Displaying an Active WEBDEV Page with parameters
- Displaying an Active WEBDEV Page with parameters from a WEBDEV page (from the interface)
- Displaying an Active WEBDEV Page with parameters from a WEBDEV page (through programming)
- Displaying an Active WEBDEV Page in a browser or from any site
- Retrieving the parameters passed to an Active WEBDEV Page
- Retrieving the parameters passed to the page
- Retrieving the paramers in the declaration code of global variables of the page
- Retrieving the parameters with PageParameter
Displaying an Active WEBDEV Page
An Active WEBDEV Page can be displayed: - from a static page or a page in Session mode of a WEBDEV site.
- directly by an address entered in the browser.
- from any page of any site.
This page can be displayed directly or it can take parameters into account. This help page presents: Displaying an Active WEBDEV Page without parameters Displaying an Active WEBDEV Page from a WEBDEV page An Active WEBDEV Page can be displayed from another WEBDEV page: - from the interface of the page: simply select the Active WEBDEV Page to open in the link description.
- through programming (server code or browser code) with PageDisplay:
Remark: In browser code, Active WEBDEV Pages do not appear in the completion suggestions. Displaying an Active WEBDEV Page in a browser or from any site To display an Active WEBDEV Page from a browser or directly from a site, use the following syntax: http://www.mysite.com/myAWPpage.awp or if the page is found in the MyDir directory: http://www.mysite.com/MyDir/myAWPpage.awp Displaying an Active WEBDEV Page with parameters Displaying an Active WEBDEV Page with parameters from a WEBDEV page (from the interface) An Active WEBDEV Page with parameters can be displayed from another WEBDEV page directly from the page interface: simply specify the Active WEBDEV Page to open in the link description. The page name must be followed by the different parameters to pass. Example: Link to MyPage.awp by passing parameters. In the definition of the link: - Click the "Other actions" button and select "Other actions: enter a link".
- Indicate the page to display followed by the necessary parameters.
Remark: If the type of the link is "None" ("Operation on the controls" option), the parameters must be named P1, P2, ..., P256. PAGE_myAWPpage.awp?P1=Instruments&P2=350 Displaying an Active WEBDEV Page with parameters from a WEBDEV page (through programming) Displaying an Active WEBDEV Page in a browser or from any site To display an Active WEBDEV Page from a browser or directly from a site by passing parameters, use the following syntax: http://www.mysite.com/PAGE_mypage.awp?P1=Instruments&P2=350 This code displays, in the "PAGE_MyPage.AWP" page, the 350th element of "Instruments" category. Retrieving the parameters passed to an Active WEBDEV Page Retrieving the paramers in the declaration code of global variables of the page To directly retrieve the parameters passed to the page in the initialization code of the page, a procedure must be declared in this process. The name of this procedure and the page name must be identical. The parameters of this procedure correspond to the parameters to pass to the page (by respecting the sequence of parameters passed to the page). These parameters can be strings, reals or integers. The parameters retrieved in the declaration code of global variables of the page are character strings. Example: - 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) - Code used to retrieve the parameters:
// -- Declaration of global variables of PAGE_MyPage // -- PROCEDURE PAGE_MyPage(Category="Toys", ID="1") // In our example: Category will be set to "Instruments" // ID will be set to "350"
Remarks: - A default value should be given to the parameters defined in the declaration code of global variables of the page. These values will be used if the page is called without parameters.
- If the page is displayed from a browser code, the parameters used in the declaration code of global variables must be named P1, ..., P256. In this case, no controls named P1, P2, ..., P256 must be found in the page.
Retrieving the parameters with PageParameter PageParameter is used to retrieve the value of one of the parameters passed to the page: Case 1: Getting the value using the name of the parameter: By default, 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. Example: - 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) - Code used to retrieve the parameters:
// Retrieve the parameters SoughtCategory is string = PageParameter("P1") SoughtID is int = PageParameter("P2")
Case 2: Getting the value using the index of the parameter: - 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) - 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)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|