ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / Developing an application or website / Controls, windows and pages / Page / Active WEBDEV Pages and sites
  • 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
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Overview
An Active WEBDEV Page can be displayed:
  • from a static page or a page in Session mode of a WEBDEV website.
  • 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:
  • directly from the page interface: simply select the AWP page to be opened in the link description.
  • by programming (in server or browser code) using the PageDisplay function:
    PageDisplay(PAGE_MyPage)
Note: In browser code, AWP pages are not offered during assisted entry.

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 AWP page with parameters can be displayed from another WEBDEV page directly from the page interface: simply indicate the AWP page to be opened in the link description.. The page name must be followed by the different parameters to pass.
Example: Link to MaPage.awp by passing it parameters.
In the definition of the link:
  1. Click on the "Other actions" button, then select the "Other actions: enter a link" option.
  2. Indicate the page to display followed by the necessary parameters.
Note: If the link is of type "None" (option "Operation on fields"), 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)

WindowsLinux Server code: To display an AWP page programmed from a WEBDEV page, use the PageDisplay function:
Each parameter of the page corresponds to a parameter of PageDisplay.
// In the "MyPage.AWP" page, displays the 350th element
// of "Instruments" category
PageDisplay(PAGE_MyPage, "Instruments", 350)

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 parameters passed to the page

Several methods can be used to retrieve the parameters passed to an Active WEBDEV Page:
  1. Retrieving the paramers in the declaration code of global variables of the page.
  2. Retrieving the parameters with PageParameter.

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:
  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:
    // -- Declaration of global variables of PAGE_MyPage // --
    PROCEDURE PAGE_MyPage(Category="Toys", ID="1")
    // In our example: Categorie will be "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: Retrieval based on parameter name:
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:
  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: Parameter index recovery:
  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)
Minimum version required
  • Version 9
Comments
Click [Add] to post a comment

Last update: 09/30/2024

Send a report | Local help