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
  • Pre-launched 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 site page in the browser of 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).
Versions 24 and later
Ajax This function is now available in Ajax mode.
New in version 24
Ajax This function is now available in Ajax mode.
Ajax This function is now available in Ajax mode.
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 "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> [, <Parameter 1> [... [, <Parameter N>]]])
<Page>: Page name
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 of the browser> [, <Options> [, <Width> [, <Height> [, <Horizontal position> [, <Vertical position> [, <Javascript parameters>]]]]]]]])
<Page>: Name of the page or character string (with quotes)
Name of 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 of the browser>: 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 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 new browser will include all 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 window in the new browser (in relation to the top left corner of the screen).
<Vertical position>: Optional integer
Vertical position (in pixels) of 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 "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 "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 displaying the page:
  • Declaration code of the global variables
  • Initialization 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).
The following processes are run when displaying the page:
  • Declaration code of global variables of control templates and internal pages.
  • Declaration code of global variables of the page.
  • Intialization on the direct child controls of the page (and recursively on the page controls and objects):
    • Declaration code of variables (if it exists and if it was not run yet: page, supercontrol, popup, ...).
    • Intialization of direct children.
    • Versions 24 and later
      Code for GUI update (if it exists).
      New in version 24
      Code for GUI update (if it exists).
      Code for GUI update (if it exists).
    • Initialization code (if it exists).
  • For all page controls (according to a browse in depth):
    • Filling the control (for the List box, Combo box, Table or browsing Looper controls)
    • End of initialization code (if it exists).
  • Running the code for updating the page GUI (if it exists).
  • Run the initialization code of the page.
Furthermore, for a page that inherits from a template, the code of template(s) is run just before the page code. For the controls that inherit from a template, ExecuteAncestor must be used to call the template code (except for the declaration code).
WEBDEV - Server codePHP

Special cases

  • 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.MyPage)
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

Pre-launched sessions

If your project is using pre-launched sessions, this function must not be used in the process "Initializing the project". This function must be used in the "Initializing the project after connection to the site" process.
New in version 20

Pre-launched sessions

If your project is using pre-launched sessions, this function must not be used in the process "Initializing the project". This function must be used in the "Initializing the project after connection to the site" process.

Pre-launched sessions

If your project is using pre-launched sessions, this function must not be used in the process "Initializing the project". This function must be used in the "Initializing the project after connection to the site" process.
Component : wd240page.dll
Minimum required version
  • Version 9
Comments
Video Page Display
https://youtu.be/TQoQuKxLELA
amarildo
Oct. 26 2018