PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Retrieving the parameters in the declaration process of global variables
  • Retrieving the parameters with PageParameter
  • Principle for opening a page
  • Processes run when the page is displayed
  • Special cases
  • Opening a page of a component
  • Cached sessions
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
Displays a page of the site in the browser of the Web user.
WEBDEV - Server code The page displayed can be a static page, a dynamic page, a semi-dynamic page or an AWP page.
WEBDEV - Browser code The page displayed can be a static WEBDEV page or an AWP page. To display an AWP page while passing parameters, use FileDisplay.
PHP The page displayed is another PHP page of the project.
Note: If PageDisplay is used in a button code, the page will be opened in the target defined for this button ("General" tab of control description or ChangeTarget).
Example
WEBDEV - Server codePHP
// Display a page according to the authorization
IF bAuthorize(Name) THEN
PageDisplay(PAGE_Welcome, Name)
ELSE
PageDisplay(PAGE_Error, "Access denied")
END
WEBDEV - Server code
// In "PAGE_MyPage.AWP", displays the 150th element
// of the "Instruments" category
PageDisplay(PAGE_MyPage,"Instruments",150)
// Displays a static page in the current frame
PageDisplay(PAGE_STATICPAGE)
// Displays any page in the current frame
IF Nation() = nationEnglish THEN
PageDisplay("US/PAGE_Example.HTM")
ELSE
PageDisplay("FR/PAGE_Example.HTM")
END
// Displays a static page in a new resizable browser
// (500x400). This browser will be closed if the calling browser is closed.
sPageName is string = "STATICPAGE"
PageDisplay(sPageName, NewBrowser, ...
"NEWBRW", ONDimension + ONScrollBar, 500, 400, 10, 20, "dependent=1")
Syntax
WEBDEV - Server codePHP
PageDisplay(<Page Name> [, <Parameter 1> [... [, <Parameter N>]]])
<Page Name>: Character string (with or without quotes)
Name of page to display. If this parameter is equal to an empty string (""), the name of the page corresponds to the page to which the current process belongs.
In test mode, specify the full path of the page if the page to open is located in a directory other than the project directory.
<Parameter 1>: Type of value sent to the page (optional)
Parameters expected by the opening process of the page to display. These parameters are passed by address and they are considered as being variables global to the page. For an AWP or PHP page, these parameters are converted into string.
<Parameter N>: Type of value sent to the page (optional)
Parameters expected by the opening process of the page to display. These parameters are passed by address and they are considered as being variables global to the page. For an AWP or PHP page, these parameters are converted into string.
Versions 15 and later
In the environment, when defining the action of a button or link, you have the ability to select the page to display to avoid programming PageDisplay in the click code. You also have the ability to define the parameters passed to the page by clicking the "Parameters" button.
The parameters can also be defined as:
  • Fixed value,
  • Reference to a page control,
  • Reference to a variable.
New in version 15
In the environment, when defining the action of a button or link, you have the ability to select the page to display to avoid programming PageDisplay in the click code. You also have the ability to define the parameters passed to the page by clicking the "Parameters" button.
The parameters can also be defined as:
  • Fixed value,
  • Reference to a page control,
  • Reference to a variable.
In the environment, when defining the action of a button or link, you have the ability to select the page to display to avoid programming PageDisplay in the click code. You also have the ability to define the parameters passed to the page by clicking the "Parameters" button.
The parameters can also be defined as:
  • Fixed value,
  • Reference to a page control,
  • Reference to a variable.
WEBDEV - Browser code
PageDisplay(<Page> [, <Target> [, <Window Name> [, <Options> [, <Width> [, <Height> [, <Horizontal Position> [, <Vertical Position> [, <Javascript Parameters>]]]]]]]])
<Page>: Character string (with or without quotes)
Name of the page to display:
  • Static page of the project or AWP page:
    The name of the page is specified without extension. The page is displayed according to the project language parameters.
    Example: The following syntax is sued to display the static page named "CompanyPage":
    PageDisplay(CompanyPage)
  • Any HTML page found in the <Project Name>_WEB directory (or in one of its sub-directories):
    The name of the page to display must correspond to the full path of the page starting from the <Project Name>_WEB directory and it must include the extension of the file. In this case, the multilingual feature must be managed.
    Example: To display "C:\My sites\MySite\MySite_WEB\Misc\HTMLPage.htm". use the following syntax:
    PageDisplay("Misc\HTMLPage.htm")
<Target>: Optional character string or constant
Name of target frame or alias of target iFrame control.
<Target> can also take the following values:
ParentFramethe target is the container of the current page (parent frameset, parent browser).
This parameter can also correspond to the "_parent" string (compatibility with WEBDEV 1.5).
CurrentFramethe target is the current frame (default value).
This parameter can also correspond to the "_self" string (compatibility with WEBDEV 1.5).
CurrentBrowserthe target is the current browser.
This parameter can also correspond to the "_top" string (compatibility with WEBDEV 1.5).
NewBrowserthe target is a new browser (a new browser window is opened). The following parameters of PageDisplay are used to configure this new window.
This parameter can also correspond to the "_blank" string (compatibility with WEBDEV 1.5).
<Window Name>: : Optional character string (with quotes)
Name of window in the new browser if <Target> is equal to the NewBrowser constant. This parameter allows you to redisplay a page in a browser with the same name (if several browsers are opened on the computer of the Web user).
<Options>: Optional Integer constant (or combination of constants)
Parameters of the window in the new browser if <Target> is equal to the NewBrowser constant:
ONLocationThe address bar will be displayed
ONScrollbarThe scrollbars will be displayed
ONFull
(Default value)
The window of the new browser will include all the options (equivalent to the combination of all constants)
ONResizableThe window of new browser will be resizable
ONLinkThe link bar will be displayed
ONMenuBarThe menu bar will be displayed
ONSatusBarThe status bar will be displayed
ONToolbarThe toolbar will be displayed
ONSimpleThe window of the new browser will be a simple window (no combination of constants).
<Width>: Optional integer
Width of window in the new browser (in pixels).
<Height>: Optional integer
Height of window in the new browser (in pixels).
<Horizontal Position>: Optional integer
Horizontal position (in pixels) of the window in the new browser (in relation to the top left corner of the screen.
<Vertical Position>: Optional integer
Vertical position (in pixels) of the window in the new browser (in relation to the top left corner of the screen.
<Javascript Parameters>: Optional character string (with quotes)
Other Javascript parameters that must be used when opening a new browser if <Target> is equal to the NewBrowser constant.
Remarks
WEBDEV - Server codePHP

Retrieving the parameters in the declaration process of global variables

To retrieve the parameters in the declaration process of the global variables of the page, specify the following line at the beginning of the process:
PROCEDURE <Page Name> (<Parameter 1> [, ...[, <Parameter N>]]])
These parameters can be strings, reals or integers. The parameters retrieved in the declaration code of global variables of the page are character strings (AWP and PHP pages only)
WEBDEV - Server codePHP

Retrieving the parameters with PageParameter

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
    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")
  • Retrieval according to the subscript of the parameter
    The 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 "PAGE_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 codePHP

Principle for opening a page

The following operations are performed by PageDisplay:
  • Creating a page context on the server (except when displaying PHP pages)
  • Return the page to the browser of web user.
PHP PageDisplay only returns the page in the browser of the Web user.
WEBDEV - Server codePHP

Processes run when the page is displayed

The following processes are run when the page is displayed:
  • Opening code of page.
  • Initialization code of controls.
  • Display the page in the browser.
  • Javascript code associated with the page and the controls.
  • WLanguage code following the call to PageDisplay (if it exists).
WEBDEV - Server codePHP

Special cases

  • The use of PageDisplay is NOT ALLOWED in the opening code of a page.
  • To redisplay a page, we recommend that you use PageRefresh.
  • To take a change of language into account (Nation), use PageUse.
  • If a page context with the same name already exists, it is deleted (and its closing code is run) before the new one is opened.
  • To display any page (not necessarily found in the site), use BrowserOpen for example.
WEBDEV - Server code

Opening a page of a component

To open a page of a component, use the name of the component page (the component being included in the project). For example:
PageDisplay(ComponentPage)
If a conflict occurs with a project element, the element name must be prefixed by the component name. For example:
PageDisplay(MyComponent.Page)
To use the name of the page in a variable, the name of the component must be specified. For example:
sPage is string = "MyComponent.MyPage"
PageDisplay(sPage)
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.
Components
WEBDEV - Server code wd230page.dll
WEBDEV - Browser code WDJS.DLL
Linux wd230page.so
Minimum required version
  • Version 9
Comments
Video Page Display
https://youtu.be/TQoQuKxLELA
amarildo
Oct. 26 2018