PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • Displaying an AWP page without parameter
  • Displaying an AWP page from a WEBDEV page
  • Displaying an AWP page in a browser or from any site
  • Displaying an AWP page with parameters
  • Displaying an AWP page with parameters from a WEBDEV page (from the interface)
  • Displaying an AWP page with parameters from a WEBDEV page (by programming)
  • Displaying an AWP page in a browser or from any site
  • Retrieving the parameters passed to an AWP 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
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
Overview
An AWP page can be displayed:
  • from a static page, a dynamic page or a semi-dynamic page of a WEBDEV site.from a static page or from a dynamic page 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 AWP page without parameter

Displaying an AWP page from a WEBDEV page

An AWP page can be displayed from another WEBDEV page:
  • from the interface of the page: all you have to do is select the AWP page to open in the link description.
  • by programming (server code or browser code) with PageDisplay:
    PageDisplay(PAGE_MyPage)
Note: In browser code, the AWP pages are not proposed during the assisted input.

Displaying an AWP page in a browser or from any site

To display an AWP 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 AWP page with parameters

Displaying an AWP 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: all you have to do is specify the AWP 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:
  1. Click the "Other actions" button and select "Other actions: enter a link".
  2. Indicate the page to display followed by the necessary parameters.
Note: 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 AWP page with parameters from a WEBDEV page (by programming)

WindowsLinux Server code: To display an AWP page with parameters from a WEBDEV page by programming, use PageDisplay:
Each page parameter corresponds to a parameter of PageDisplay.
// In the "MyPage.AWP" page, displays the 350th element
// of the "Instruments" category
PageDisplay(PAGE_MyPage, "Instruments", 350)
WEBDEV - Browser code Browser code: To display an AWP page with parameters from a WEBDEV page by programming, use FileDisplay. Several cases are possible.
  1. Displaying an AWP page from a dynamic page
    • Case 1: if the page to display is found in the current site, the name of the page must correspond to the full path in the URL of the page followed by the parameters to pass to the page.
      FileDisplay(FolderWeb() + "US/PAGE_MyPage.AWP?P1=125&P2=Moore")
    • Case 2: if the page to display is found in another site, the page name must correspond to the full page URL followed by the parameters to pass to the page.
      FileDisplay("http://MySite/MyDir/US/PAGE_MyPage.AWP?P1=125&P2=Moore")
  2. Displaying an AWP page from another AWP page
    • Case 1: if the page to display is found in the current site and in the same language, the name of the page must correspond to the relative path of the page in relation to the language directory. The name of the page is followed by the parameters that must be passed to the page.
      FileDisplay("PAGE_MyPage.AWP?P1=125&P2=Moore")
    • Case 2: if the page to display is found in the current site and in a different language, the name of the page must correspond to the relative path of the page in relation to the directory of source language. The name of the page is followed by the parameters that must be passed to the page.
      FileDisplay("../US/PAGE_MyPage.AWP?P1=125&P2=Moore")
    • Case 3: if the page to display is found in another site, the page name must correspond to the full page URL followed by the parameters to pass to the page.
      FileDisplay("http://MySite/MyDir/US/PAGE_MyPage.AWP?P1=125&P2=Moore")

Displaying an AWP page in a browser or from any site

To display an AWP 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 AWP page

Retrieving the parameters passed to the page

Several methods can be used to retrieve the parameters passed to an AWP 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 the "Instruments" category
    PageDisplay(PAGE_MyPage, "Instruments", 350)
  2. Code used to retrieve the parameters:
    // -- Declaration of global variables of PAGE_MyPage // --
    PROCÉDURE PAGE_MyPage(Category="Toys", ID="1")
    // In our example: Category will be set to "Instruments"
    // ID will be set to "350"
Notes:
  • 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 according to the 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 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:
  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)
Minimum required version
  • Version 9
Comments
Click [Add] to post a comment