PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • 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 AWP page to a dynamic WEBDEV page?
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
Starts a dynamic WEBDEV site from a static page or or from a dynamic WEBDEV page. The dynamic site to start must be found on the same Web server as the current site.
Example
// Displays a dynamic site in the current frame
DynamicSiteDisplay("MYSITE")
// Displays a site in a new resizable browser (500x400)
// The browser can be closed only if the calling browser is closed
sSiteName is string = "MYSITE"
DynamicSiteDisplay(sSiteName, "", "", NewBrowser, ...
"NEWBRW", ONDimension + 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 (with quotes)
Name of the WEBDEV site to display.
<Page>: Optional character string (with quotes)
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 (with quotes)
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:
<Name parameter1>=<value parameter1> [&<Name parameter2>=<value parameter2> [...]>]
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 (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 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 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. For example, "dependent = 1" is used to force the closing of the new browser if the current browser is closed.
Remarks

Multilingual

DynamicSiteDisplay automatically transmits the current language of the current page to the WEBDEV site to display. 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. The "Allow the access by DynamicSiteDisplay()" option must be checked for this page in the "Advanced" 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 advisable to directly pass the name of the page to display in parameter to 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":
// Retrieves the number of the page to display
PageNumber is int = PageParameter("Param")
// according to the page number
SWITCH PageNumber
CASE 1: PageDisplay(PageToDisplay)
END

// If no default page was specified,
// the first page of the project is displayed

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 AWP page to a dynamic WEBDEV page?

The "Allow the access by DynamicSiteDisplay" option must be enabled for the dynamic page in the "Advanced" tab of the page description.
Another AWP page includes a button whose description is:
  • Operations on the controls = none
  • Action = None
Example of code for this button:
sParameters is string
sParameters = "P1=" + STC_P1 + "&P2=" + STC_P2 + "&P3=" + STC_P3
DynamicSiteDisplay("MYSITE", "MYPAGE", sParameters, NewBrowser)
Example for retrieving these parameters in the declaration code of the global variables of dynamic page:
nParam1 is int = PageParameter("P1")
bParam2 is boolean = PageParameter("P2")
sParam2 is string = PageParameter("P3")
Components
WEBDEV - Browser code WDJS.DLL
Minimum required version
  • Version 9
Comments
Click [Add] to post a comment