PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Multilingual
  • Displaying a page other than the first page of the site
  • Security: How to select the page to display
  • Choosing the target
  • Caution
  • How to pass parameters from an Active WEBDEV Page to a dynamic (Session mode) WEBDEV page?
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Starts a dynamic WEBDEV site from a static page or or from a dynamic WEBDEV page. The dynamic site to start must be on the same Web server as the current site.
Example
// Affiche un site dynamique dans le cadre en cours
DynamicSiteDisplay("MONSITE")
// Affiche un site dans un nouveau navigateur redimensionnable (500x400)
// La fermeture du navigateur pourra être effectuée si le navigateur appelant est fermé
sNomSite is string = "MONSITE"
DynamicSiteDisplay(sNomSite, "", "", NewBrowser, ...
"NOUVNAV", ONResizable + ONScrollBar, 500, 400, 0, 0, "dependent=1")
Syntax
DynamicSiteDisplay(<Site> [, <Page> [, <HTTP Parameters> [, <Destination> [, <Window name> [, <Options> [, <Width> [, <Height> [, <Horizontal position> [, <Vertical position> [, <JavaScript parameters>]]]]]]]]]])
<Site>: Character string
Name of the WEBDEV site to display.
<Page>: Optional character string
Name of page to display. If this parameter is not specified or if it corresponds to an empty string (""), the first page of the site will be displayed.
<HTTP Parameters>: Optional character string
Parameter that must be passed to the dynamic WEBDEV site. These parameters can be retrieved by PageParameter. The list of parameters must have the following format:
<Nom paramètre1>=<valeur paramètre1> [&<Nom paramètre2>=<valeur paramètre2> [...]>]
For example: "param1=1&param2=text"
This parameter can correspond to an empty string ("") if no parameter must be passed to the site.
<Destination>: Optional character string or constant
Name of target frame. <Destination> 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 DynamicSiteDisplay 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
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 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 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 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
Other JavaScript parameters that must be used when opening a new browser if <Target> is equal to the NewBrowser constant. For example, "dependent = 1" is used to force the closing of the new browser if the current browser is closed.
Remarks

Multilingual

The DynamicSiteDisplay function automatically transmits the current language of the current page to the WEBDEV site to be displayed. Therefore, if the current page is in French (Nation(5)), the WEBDEV site will be started in French.

Displaying a page other than the first page of the site

The <Page> parameter can correspond to any page of the site. For this page, the option "Accessible via the DynamicSiteDisplay function" must be checked in the "General" tab of the page description.

Security: How to select the page to display

To choose the page of the dynamic site to display, we recommend that you use a custom mechanism for page identification.
For security reasons, it is not recommended to pass directly the name of the page to be displayed as a parameter to the function DynamicSiteDisplay. Use a numeric identifier instead.
Example: In the browser click code of a page:
DynamicSiteDisplay("Site", "", "Param=1")
In the initialization code of "Site":
// Récupère le numéro de la page à afficher
NuméroPage is int = PageParameter("Param")
// selon le numéro de page
SWITCH NuméroPage
CASE 1: PageDisplay(PageAAfficher)
END
 
// Si on n'a pas précisé de page par défaut,
// on laisse s'afficher la première page du projet

Choosing the target

To choose the target of the file, we recommend that you use the <Target> parameter of DynamicSiteDisplay rather than ChangeTarget. Indeed, in this case, the corresponding JavaScript code is smaller and the size of your pages is optimized.

Caution

Even though DynamicSiteDisplay is a function used in browser code, its call triggers a return to the server. Therefore, this function should not be used from a "Submit" button with a server code.

How to pass parameters from an Active WEBDEV Page to a dynamic (Session mode) WEBDEV page?

The "Accessible via the DynamicSiteDisplay function" option must be enabled for the dynamic page (Session mode) in the "General" tab of the page description.
Another Active WEBDEV Page has a Button control for which the option "During the action" is set to "Do not send anything to the server".
Example of code for this button:
sParametres is string
sParametres = "P1=" + LIB_P1 + "&P2=" + LIB_P2 + "&P3=" + LIB_P3
DynamicSiteDisplay("MONSITE", "MAPAGE", sParametres, NewBrowser)
Example for retrieving these parameters in the declaration code of global variables of dynamic page:
nParam1 is int = PageParameter("P1")
bParam2 is boolean = PageParameter("P2")
sParam2 is string = PageParameter("P3")
Component: WDJS.DLL
Minimum version required
  • Version 9
Comments
Click [Add] to post a comment