ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Web-specific functions / Page functions
  • Tip: optimize the size of your HTML files
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
ChangeTarget (Function)
In french: ChangeDestination
Changes the target of a button action.
By default, the target is defined in the "General" tab of the button run or current page
Caution: ChangeTarget can be directly used only in the browser process that corresponds to the server action of the control:
  • browser click code for a Button, Link or Image control.
  • "Whenever modifying" code for Radio Button, Check Box, List Box or Combo Box controls.
ChangeTarget has no effect in the other browser processes or in a local browser procedure, even if this procedure is called by one of the above processes.
Example
// -- Browser click code of the Button control
// The target of the button defined in the description window (current frame)
ChangeTarget(CurrentBrowser)
 
// -- Server click code of the Button control
IF CheckUserName(EDT_UserName) = False THEN
// Refreshes the PAGE_Identification page
PageRefresh(PAGE_Identification)
ELSE
// Displays the home page
PageDisplay(PAGE_Welcome)
END
Syntax
ChangeTarget(<Target> [, <Name of the window> [, <Options> [, <Width> [, <Height> [, <Horizontal position> [, <Vertical position> [, <JavaScript parameters>]]]]]]])
<Target>: Character string or constant
Name of target frame or alias of target iFrame control.
<Target> can also take the following values:
CurrentBrowserThe target is the current browser.
This parameter can also correspond to the "_top" 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).
NewBrowserThe target is a new browser (a new browser window is opened). The following parameters of ChangeTarget are used to configure the browser window.
This parameter can also correspond to the "_blank" string (compatibility with WEBDEV 1.5).
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).
<Name of the window>: : Optional character string
Name of the window of the new browser if <Target> is equal to the NewBrowser constant (or to "_blank"). 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). This name is a unique name (equivalent to the name of a JavaScript variable).
Caution: This name must contain no space character, no accented character and no special character.
<Options>: Optional Integer constant (or combination of constants)
Parameters of the new browser window if <Target> is equal to the NewBrowser constant (or to "_blank"):
ONFull
(Default value)
The window of the new browser will include an address bar and scrollbars (equivalent to the combination of all the previous constants)
ONLinkThe link bar will be displayed
ONLocationThe address bar will be displayed
ONMenuBarThe menu bar will be displayed
ONResizableThe new browser window will be resizable
ONSatusBarThe status bar will be displayed
ONScrollbarThe scrollbars will be displayed
ONSimpleThe window of the new browser will be a simple window (no combination of constants).
ONToolbarThe toolbar will be displayed
<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 upper-left corner of the screen).
<Vertical position>: Optional integer
Vertical position (in pixels) of the window in the new browser (in relation to the upper-left corner of the screen).
<JavaScript parameters>: Optional character string
Other JavaScript parameters to use when opening a new browser if <Target> is equal to the NewBrowser constant (or to "_blank").
Remarks

Tip: optimize the size of your HTML files

For PageDisplay, SemiDynamicPageDisplay, DynamicSiteDisplay and FileDisplay, we recommend that you change the target in these functions directly. Indeed, the corresponding JavaScript code included in the HTML files is smaller.
Component: WDJS.DLL
Minimum version required
  • Version 9
Comments
Click [Add] to post a comment

Last update: 06/23/2023

Send a report | Local help