Child pages
  • JSWindow

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Divcache
Div
iddescription
HTML Table
id
classservoy sSummary
Colgroup Tag
Col
width80px
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Constants Summary
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)DEFAULT
indexstyletruedisplay:none

DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING.
THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO AUTO UPDATE THE CONTENT THROUGH THE DOC GENERATOR.

refresh100d
showRefreshtrue
iddoc
titleRefresh page
showDatetrue
retryEnable
idclass

servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClient

servoy sSummary12%30%58%height: 30px;3Constants SummaryValue used for x, y, width, height of initial bounds when you want the window to auto-determine bounds when shown for the first time. Table Row (tr)

Table Cell (td)
Number
Table Cell (td)DIALOG
Window type constant that identifies a non-modal dialog type. Table Row (tr)
Table Cell (td)
Number
Table Cell (td)FULL_SCREEN
Value that can be used for bounds in order to specify that a dialog/window should completely fill the screen. Table Row (tr)
Table Cell (td)
Number
Table Cell (td)MODAL_DIALOG
Window type Table Row (tr)
Table Cell (td)
Number
Table Cell (td)WINDOW
Window type constant that identifies a modal dialog type.Window type constant that identifies a window type. HTML Table

Colgroup Tag
Col
width80px
Col
Table Head (thead) Table Row (tr)styleservoy sSummaryid12%30%58%height: 30px;
Table Head (th)
colspan2
Property Summary
Table Row (tr)
Table Cell (td)
controller
Table Cell (td)controller
3Property SummaryGet the current controller from the window/dialog. Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)resizable
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)storeBounds
Gets/Sets the opacity property.Gets/Sets whether or not this window can be resized by the user (default true). Table Row (tr)
Table Cell (td)
String
Table Cell (td)title
Tells whether or not the bounds of this window should be stored/persisted (default false).Gets/Sets the title text. Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)undecorated
.Gets/Sets the transparency property.Gets/Sets the undecorated property. HTML Table

classservoy sSummary

Colgroup Tag
Col
width80px
Col
Table Head (thead) Table Row (tr)styleservoy sSummary12%30%58%height: 30px;
Table Head (th)
colspan2
Method Summary
Table Row (tr)
Table Cell (td)
void
Table Cell (td)destroy()
getHeight()
3Methods SummaryvoidFrees the resources allocated by this window. Table Row (tr)
Table Cell (td)
Number
Table Cell (td)Returns the height. Table Row (tr)
Table Cell (td)
String
Table Cell (td)getName()
Table Cell (td)getParent()
Returns the window name. Table Row (tr)
Table Cell (td)
JSWindow
Returns the parent JSWindow, if available. Table Row (tr)
Table Cell (td)
Number
Table Cell (td)getType()
Table Cell (td)getX()
Returns the window type.
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
getWidth()
Returns the width.
Table Row (tr)
Table Cell (td)
Number
getY()
Returns the width.Returns the x coordinate. Table Row (tr)
Table Cell (td)
Number
Table Cell (td) Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)hide()
Returns the y coordinate.Hides the window. Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)isVisible()
Table Row (tr) Table Cell (td)Returns true if the window is visible, false otherwise.void Table Cell (td)resetBounds()
Table Row (tr)
Table Cell (td)
void
Table Cell (td)setInitialBounds(x, y, width, height)
Deletes the window's currently stored bounds. Table Row (tr) Table Cell (td)voidSets the initial window bounds.void Table Cell (td)setLocation(x, y)
Table Row (tr) Table Cell (td)Set the window location.void Table Cell (td)setSize(width, height)
Table Row (tr) Table Cell (td)Set the window size.void Table Cell (td)show(form)
Table Row (tr) Table Cell (td)Shows the given form(form name, form object or JSForm) in this window.void Table Cell (td)showTextToolbar(showTextToolbar)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)toBack()
Shows Sets whether or not this window should have a text tool bar. Table Row (tr) Table Cell (td)voidShows this window behind other windows, if possible.toFront()
void Table Cell (td)Bring this window in front of other windows, if possible.table

id

constantclass Colgroup Tag Colcolspanservoy sDetailwidth2100%

Col
Table Head (thead) Table Row (tr)styleheight:30px; Table Head (th)colspan2Constants Details Table Body (tbody)ididDEFAULT Table Row (tr)name

Table Cell (td)

DEFAULT

Table Row (tr)
iddes
Table Cell (td) Div
classsIndent
Value used Table Row (tr)iddessIndentValue used for x, y, width, height of initial bounds when you want the window to auto-determine bounds when shown for the first time.tdret

Returns

divsIndentclients

classtd

Supported Clients

sIndent
Number Table Row (tr)
idsam
SmartClient,WebClient,NGClientsam

Sample

Div
classsIndent
Code Block
languagejavascript
// show a dialog that self-determines bounds the first time it it open, then remembers last bounds for future show operations
var win = application.createWindow("myName", JSWindow.DIALOG);
win.setInitialBounds(JSWindow.DEFAULT, JSWindow.DEFAULT, JSWindow.DEFAULT, JSWindow.DEFAULT); // will be shown initially centred and with preferred size
forms.myForm.show(win);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idDIALOG
Table Row (tr)
idname
Table Cell (td)

DIALOG

Table Row (tr)
iddes
Table Cell (td) Div
classsIndent
Window type constant that identifies a non-modal dialog type.
Non-modal dialogs will allow the user to interact with parent windows, but are less independent then windows with WINDOW type.
sIdentjavascriptlastDetailRow DIALOGname

DIALOG

dessIndentWindow type constant that identifies a non-modal dialog type. Non-modal dialogs will allow the user to interact with parent windows, but are less independent then windows with WINDOW type. Dialogs will stay on top of parent windows and are less accessible through the OS window manager. In web-client dialogs will not open in a separate browser window.ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow 
FULL_SCREENname

FULL_SCREEN

dessIndentValue that can be used for bounds in order to specify that a dialog/window should completely fill the screen.ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow 
MODAL_DIALOGname

MODAL_DIALOG

dessIndentWindow type constant that identifies a modal dialog type. Modal dialogs will not allow the user to interact with the parent window(s) until closed. Dialogs will stay on top of parent windows and are less accessible through the OS window manager. In web-client dialogs will not

open in a separate browser window.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// create a non-modal dialog on top of current active form's window and show a form inside it
var myWindow = application.createWindow("myName", JSWindow.DIALOG);
myWindow.show(forms.myForm);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idFULL_SCREEN
Table Row (tr)
idname
Table Cell (td)

FULL_SCREEN

Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Value that can be used for bounds in order to specify that a dialog/window should completely fill the screen.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// create and show a window, with specified title, full screen
var win = application.createWindow("windowName", JSWindow.WINDOW);
win.setInitialBounds(JSWindow.FULL_SCREEN, JSWindow.FULL_SCREEN, JSWindow.FULL_SCREEN, JSWindow.FULL_SCREEN);
win.setTitle("This is a window");
controller.show(win);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idMODAL_DIALOG
Table Row (tr)
idname
Table Cell (td)

MODAL_DIALOG

Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Window type constant that identifies a modal dialog type. Modal dialogs will not allow the user to interact with the parent window(s) until closed.
Dialogs will stay on top of parent windows and are less accessible through the OS window manager. In web-client dialogs will not
open in a separate browser window. NOTE: no code is executed in Smart Client after a modal dialog is shown (the show operation blocks) until this dialog closes.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// create a modal dialog on top of current active form's window and show a form inside it
var myWindow = application.createWindow("myName", JSWindow.MODAL_DIALOG);
myWindow.show(forms.myForm);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idWINDOW
Table Row (tr)
idname
Table Cell (td)

WINDOW

Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Window type constant that identifies a window type. WINDOW type is the most independent type of window. It will be more accessible through the OS window
manager, it can appear both in front of and under other windows and it doesn't block user interaction for other windows. In web-client windows will
open in a separate browser window.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// create a window and show a form inside it
var myWindow = application.createWindow("myName", JSWindow.WINDOW);
myWindow.show(forms.myForm);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
HTML Table
idproperty
classservoy sDetail
Colgroup Tag
Col
colspan2
width100%
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Property Details
Table Body (tbody)
idcontroller
Table Row (tr)
idname
Table Cell (td)

controller

Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get the current controller from the window/dialog.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
controller
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var formName = application.getWindow('test').controller.getName();
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idresizable
Table Row (tr)
idname
Table Cell (td)

resizable

Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Gets/Sets whether or not this window can be resized by the user (default true).
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var someWindow = application.getWindow("someWindowName");
if (someWindow.isVisible() == false) {
	controller.show(someWindow);
	someWindow.resizable = false;
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idstoreBounds
Table Row (tr)
idname
Table Cell (td)

storeBounds

Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Tells whether or not the bounds of this window should be stored/persisted (default false).
If true, the window's bounds will be stored when the window is closed. Stored bounds will be used when the window is shown again instead of initialBounds.
For non resizable windows, only location is stored/persisted.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var win1 = application.createWindow("Window 1", JSWindow.DIALOG, null);
win1.setInitialBounds(200, 200, 450, 350);
win1.resizable = false;
win1.storeBounds = true;
win1.title = "Window 1";
controller.show(win1);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idtitle
Table Row (tr)
idname
Table Cell (td)

title

Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Gets/Sets the title text.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
String
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var win1 = application.createWindow("Window 1", JSWindow.WINDOW, null);
win1.setInitialBounds(200, 200, 450, 350);
win1.title = "Window 1";
controller.show(win1);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idundecorated
Table Row (tr)
idname
Table Cell (td)

undecorated

Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Gets/Sets the undecorated property.
If set then this window will not have any decoration and can't be moved/resized or closed.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean - if this window will be undecorated
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var someWindow = application.createWindow("someWindowName", JSWindow.WINDOW, null);
someWindow.setInitialBounds(200, 200, 450, 350);
controller.show(someWindow);

var name = "Name: " + someWindow.getName() + "\n"
var parent = "Parent: " + (someWindow.getParent() == null ? "none" : someWindow.getParent()) + "\n"
var type = "TypeNumber: " + someWindow.getType() + "\n"
var height = "Height: " + someWindow.getHeight() + "\n"
var width = "Width: " + someWindow.getWidth() + "\n"
var undecorated = "Undecorated: " + someWindow.isUndecorated() + "\n"
var locationX = "Location-X-coordinate: " + someWindow.getX() + "\n"
var locationY = "Location-Y-coordinate: " + someWindow.getY() + "\n"
var info = name + parent + type + height + width + locationX + locationY + undecorated + "\n"
var closeMsg = "Press 'Ok' to close this dialog."

var infoDialog = plugins.dialogs.showInfoDialog("Window Info", info + closeMsg, "Ok");
if (infoDialog == "Ok") someWindow.close()
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
HTML Table
idfunction
classservoy sDetail
Colgroup Tag
Col
colspan2
width100%
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Details
Table Body (tbody)
iddestroy
Table Row (tr)
idname
Table Cell (td)

destroy

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
destroy
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

Frees the resources allocated by this window. If window is visible, it will close it first.
The window will no longer be available with application.getWindow('windowName') and will no longer be usable.

The main application window cannot be destroyed.

Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var getWindow = application.getWindow("someWindowName");
getWindow.destroy();
getWindow = application.getWindow("someWindowName");
if (getWindow == null) {
	application.output("Window has been destroyed");
} else {
	application.output("Window could not be destroyed");
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetHeight
Table Row (tr)
idname
Table Cell (td)

getHeight

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
getHeight
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns the height.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number - the height.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var someWindow = application.createWindow("someWindowName", JSWindow.WINDOW, null);
someWindow.setInitialBounds(200, 200, 450, 350);
controller.show(someWindow);

var name = "Name: " + someWindow.getName() + "\n"
var parent = "Parent: " + (someWindow.getParent() == null ? "none" : someWindow.getParent()) + "\n"
var type = "TypeNumber: " + someWindow.getType() + "\n"
var height = "Height: " + someWindow.getHeight() + "\n"
var width = "Width: " + someWindow.getWidth() + "\n"
var undecorated = "Undecorated: " + someWindow.isUndecorated() + "\n"
var locationX = "Location-X-coordinate: " + someWindow.getX() + "\n"
var locationY = "Location-Y-coordinate: " + someWindow.getY() + "\n"
var info = name + parent + type + height + width + locationX + locationY + undecorated + "\n"
var closeMsg = "Press 'Ok' to close this dialog."

var infoDialog = plugins.dialogs.showInfoDialog("Window Info", info + closeMsg, "Ok");
if (infoDialog == "Ok") someWindow.close()
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetName
Table Row (tr)
idname
Table Cell (td)

getName

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getName
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns the window name. It will be null in case of main application frame.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
String - the window name.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var someWindow = application.createWindow("someWindowName", JSWindow.WINDOW, null);
someWindow.setInitialBounds(200, 200, 450, 350);
controller.show(someWindow);

var name = "Name: " + someWindow.getName() + "\n"
var parent = "Parent: " + (someWindow.getParent() == null ? "none" : someWindow.getParent()) + "\n"
var type = "TypeNumber: " + someWindow.getType() + "\n"
var height = "Height: " + someWindow.getHeight() + "\n"
var width = "Width: " + someWindow.getWidth() + "\n"
var undecorated = "Undecorated: " + someWindow.isUndecorated() + "\n"
var locationX = "Location-X-coordinate: " + someWindow.getX() + "\n"
var locationY = "Location-Y-coordinate: " + someWindow.getY() + "\n"
var info = name + parent + type + height + width + locationX + locationY + undecorated + "\n"
var closeMsg = "Press 'Ok' to close this dialog."

var infoDialog = plugins.dialogs.showInfoDialog("Window Info", info + closeMsg, "Ok");
if (infoDialog == "Ok") someWindow.close()
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetParent
Table Row (tr)
idname
Table Cell (td)

getParent

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
JSWindow
Span
stylefont-weight: bold;
getParent
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns the parent JSWindow, if available.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
JSWindow - the parent JSWindow, if available. If there is no parent JSWindow, it will return null.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var someWindow = application.createWindow("someWindowName", JSWindow.WINDOW, null);
someWindow.setInitialBounds(200, 200, 450, 350);
controller.show(someWindow);

var name = "Name: " + someWindow.getName() + "\n"
var parent = "Parent: " + (someWindow.getParent() == null ? "none" : someWindow.getParent()) + "\n"
var type = "TypeNumber: " + someWindow.getType() + "\n"
var height = "Height: " + someWindow.getHeight() + "\n"
var width = "Width: " + someWindow.getWidth() + "\n"
var undecorated = "Undecorated: " + someWindow.isUndecorated() + "\n"
var locationX = "Location-X-coordinate: " + someWindow.getX() + "\n"
var locationY = "Location-Y-coordinate: " + someWindow.getY() + "\n"
var info = name + parent + type + height + width + locationX + locationY + undecorated + "\n"
var closeMsg = "Press 'Ok' to close this dialog."

var infoDialog = plugins.dialogs.showInfoDialog("Window Info", info + closeMsg, "Ok");
if (infoDialog == "Ok") someWindow.close()
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetType
Table Row (tr)
idname
Table Cell (td)

getType

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
getType
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns the window type.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number - the window type. Can be one of JSWindow.DIALOG, JSWindow.MODAL_DIALOG, JSWindow.WINDOW.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var someWindow = application.createWindow("someWindowName", JSWindow.WINDOW, null);
someWindow.setInitialBounds(200, 200, 450, 350);
controller.show(someWindow);

var name = "Name: " + someWindow.getName() + "\n"
var parent = "Parent: " + (someWindow.getParent() == null ? "none" : someWindow.getParent()) + "\n"
var type = "TypeNumber: " + someWindow.getType() + "\n"
var height = "Height: " + someWindow.getHeight() + "\n"
var width = "Width: " + someWindow.getWidth() + "\n"
var undecorated = "Undecorated: " + someWindow.isUndecorated() + "\n"
var locationX = "Location-X-coordinate: " + someWindow.getX() + "\n"
var locationY = "Location-Y-coordinate: " + someWindow.getY() + "\n"
var info = name + parent + type + height + width + locationX + locationY + undecorated + "\n"
var closeMsg = "Press 'Ok' to close this dialog."

var infoDialog = plugins.dialogs.showInfoDialog("Window Info", info + closeMsg, "Ok");
if (infoDialog == "Ok") someWindow.close()
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetWidth
Table Row (tr)
idname
Table Cell (td)

getWidth

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
getWidth
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns the width.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number - the width.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var someWindow = application.createWindow("someWindowName", JSWindow.WINDOW, null);
someWindow.setInitialBounds(200, 200, 450, 350);
controller.show(someWindow);

var name = "Name: " + someWindow.getName() + "\n"
var parent = "Parent: " + (someWindow.getParent() == null ? "none" : someWindow.getParent()) + "\n"
var type = "TypeNumber: " + someWindow.getType() + "\n"
var height = "Height: " + someWindow.getHeight() + "\n"
var width = "Width: " + someWindow.getWidth() + "\n"
var undecorated = "Undecorated: " + someWindow.isUndecorated() + "\n"
var locationX = "Location-X-coordinate: " + someWindow.getX() + "\n"
var locationY = "Location-Y-coordinate: " + someWindow.getY() + "\n"
var info = name + parent + type + height + width + locationX + locationY + undecorated + "\n"
var closeMsg = "Press 'Ok' to close this dialog."

var infoDialog = plugins.dialogs.showInfoDialog("Window Info", info + closeMsg, "Ok");
if (infoDialog == "Ok") someWindow.close()
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetX
Table Row (tr)
idname
Table Cell (td)

getX

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
getX
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns the x coordinate.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number - the x coordinate.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var someWindow = application.createWindow("someWindowName", JSWindow.WINDOW, null);
someWindow.setInitialBounds(200, 200, 450, 350);
controller.show(someWindow);

var name = "Name: " + someWindow.getName() + "\n"
var parent = "Parent: " + (someWindow.getParent() == null ? "none" : someWindow.getParent()) + "\n"
var type = "TypeNumber: " + someWindow.getType() + "\n"
var height = "Height: " + someWindow.getHeight() + "\n"
var width = "Width: " + someWindow.getWidth() + "\n"
var undecorated = "Undecorated: " + someWindow.isUndecorated() + "\n"
var locationX = "Location-X-coordinate: " + someWindow.getX() + "\n"
var locationY = "Location-Y-coordinate: " + someWindow.getY() + "\n"
var info = name + parent + type + height + width + locationX + locationY + undecorated + "\n"
var closeMsg = "Press 'Ok' to close this dialog."

var infoDialog = plugins.dialogs.showInfoDialog("Window Info", info + closeMsg, "Ok");
if (infoDialog == "Ok") someWindow.close()
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetY
Table Row (tr)
idname
Table Cell (td)

getY

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
getY
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns the y coordinate.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number - the y coordinate.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var someWindow = application.createWindow("someWindowName", JSWindow.WINDOW, null);
someWindow.setInitialBounds(200, 200, 450, 350);
controller.show(someWindow);

var name = "Name: " + someWindow.getName() + "\n"
var parent = "Parent: " + (someWindow.getParent() == null ? "none" : someWindow.getParent()) + "\n"
var type = "TypeNumber: " + someWindow.getType() + "\n"
var height = "Height: " + someWindow.getHeight() + "\n"
var width = "Width: " + someWindow.getWidth() + "\n"
var undecorated = "Undecorated: " + someWindow.isUndecorated() + "\n"
var locationX = "Location-X-coordinate: " + someWindow.getX() + "\n"
var locationY = "Location-Y-coordinate: " + someWindow.getY() + "\n"
var info = name + parent + type + height + width + locationX + locationY + undecorated + "\n"
var closeMsg = "Press 'Ok' to close this dialog."

var infoDialog = plugins.dialogs.showInfoDialog("Window Info", info + closeMsg, "Ok");
if (infoDialog == "Ok") someWindow.close()
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idhide
Table Row (tr)
idname
Table Cell (td)

hide

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
hide
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Hides the window. It can be shown again using window.show(), controller.show() or controller.showRecords().
The main application window cannot be hidden.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean - Boolean true if the window was successfully closed and false otherwise.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
//creates and shows a window for 3 seconds before closing it
var win = application.createWindow("someWindowName", JSWindow.WINDOW, null);
win.setInitialBounds(200, 200, 450, 350);
controller.show(win);
application.sleep(3000);
win.hide();
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idisVisible
Table Row (tr)
idname
Table Cell (td)

isVisible

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
isVisible
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns true if the window is visible, false otherwise.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean - true if the window is visible, false otherwise.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var someWindow = application.getWindow("someWindowName");
if (someWindow.isVisible() == false) {
	controller.show(someWindow);
	someWindow.resizable = false;
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idresetBounds
Table Row (tr)
idname
Table Cell (td)

resetBounds

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
resetBounds
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Deletes the window's currently stored bounds. It will only affect the next show of the window.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var win1 = application.createWindow("Window 1", JSWindow.DIALOG, null);
win1.title = "Window 1";
win1.setInitialBounds(200, 200, 400, 600);
win1.storeBounds = true;
if (newSolutionVersion) win1.resetBounds();
win1.show(forms.myform);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsetInitialBounds-Number_Number_Number_Number
Table Row (tr)
idname
Table Cell (td)

setInitialBounds

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
setInitialBounds
Span
(x, y, width, height)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Sets the initial window bounds.
The initial bounds are only used the first time this window is shown (what first show means depends on storeBounds property).
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Number} x - the initial x coordinate of the window. Can be JSWindow.DEFAULT, JSWindow.FULL_SCREEN.
{Number} y - the initial y coordinate of the window. Can be JSWindow.DEFAULT, JSWindow.FULL_SCREEN.
{Number} width - the initial width of the window. Can be JSWindow.DEFAULT, JSWindow.FULL_SCREEN.
{Number} height - the initial height of the window. Can be JSWindow.DEFAULT, JSWindow.FULL_SCREEN.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var win = application.createWindow("myName", JSWindow.DIALOG);
win.setInitialBounds(20, 10, 300, 200);
forms.myForm.show(win);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsetLocation-Number_Number
Table Row (tr)
idname
Table Cell (td)

setLocation

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
setLocation
Span
(x, y)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Set the window location.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Number} x - x coordinate.
{Number} y - y coordinate.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var window = application.createWindow('test',JSWindow.DIALOG);
window.show(forms.child1);
window.setLocation(0,0);
window.setSize(400,600);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsetSize-Number_Number
Table Row (tr)
idname
Table Cell (td)

setSize

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
setSize
Span
(width, height)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Set the window size.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Number} width - the width.
{Number} height - the height.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var window = application.createWindow('test',JSWindow.DIALOG);
window.show(forms.child1);
window.setLocation(0,0);
window.setSize(400,600);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idshow-Object
Table Row (tr)
idname
Table Cell (td)

show

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
show
Span
(form)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Shows the given form(form name, form object or JSForm) in this window.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} form - the form that will be shown inside this window. It can be a form name or a form object (actual form or JSForm).
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
win.show(forms.myForm);
// win.show("myForm");
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idshowTextToolbar-Boolean
Table Row (tr)
idname
Table Cell (td)

showTextToolbar

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
showTextToolbar
Span
(showTextToolbar)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Sets whether or not this window should have a text tool bar. Has no effect on web client or smart client main application frame.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Boolean} showTextToolbar - true if you want a text tool bar to be added to this window, false otherwise.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var win1 = application.createWindow("Window 1", JSWindow.WINDOW, null);
win1.setInitialBounds(200, 200, 450, 350);
win1.setTitle("Window 1");
win1.showTextToolbar(false);
controller.show(win1);

var win2 = application.createWindow("Window 2", JSWindow.WINDOW, null);
win2.setInitialBounds(500, 500, 450, 350);
win2.setTitle("Window 2");
win2.showTextToolbar(false);
controller.show(win2);

var win3 = application.createWindow("Window 3", JSWindow.WINDOW, null);
win3.setInitialBounds(650, 700, 450, 350);
win3.setTitle("Window 3");
win3.showTextToolbar(true);
controller.show(win3);

application.sleep(2000);
win3.toBack();
application.sleep(2000);
win1.toFront();
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idtoBack
Table Row (tr)
idname
Table Cell (td)

toBack

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
toBack
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Shows this window behind other windows, if possible.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var win1 = application.createWindow("Window 1", JSWindow.WINDOW, null);
win1.setInitialBounds(200, 200, 450, 350);
win1.setTitle("Window 1");
win1.showTextToolbar(false);
controller.show(win1);

var win2 = application.createWindow("Window 2", JSWindow.WINDOW, null);
win2.setInitialBounds(500, 500, 450, 350);
win2.setTitle("Window 2");
win2.showTextToolbar(false);
controller.show(win2);

var win3 = application.createWindow("Window 3", JSWindow.WINDOW, null);
win3.setInitialBounds(650, 700, 450, 350);
win3.setTitle("Window 3");
win3.showTextToolbar(true);
controller.show(win3);

application.sleep(2000);
win3.toBack();
application.sleep(2000);
win1.toFront();
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idtoFront
Table Row (tr)
idname
Table Cell (td)

toFront

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
toFront
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Bring this window in front of other windows, if possible.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var win1 = application.createWindow("Window 1", JSWindow.WINDOW, null);
win1.setInitialBounds(200, 200, 450, 350);
win1.setTitle("Window 1");
win1.showTextToolbar(false);
controller.show(win1);

var win2 = application.createWindow("Window 2", JSWindow.WINDOW, null);
win2.setInitialBounds(500, 500, 450, 350);
win2.setTitle("Window 2");
win2.showTextToolbar(false);
controller.show(win2);

var win3 = application.createWindow("Window 3", JSWindow.WINDOW, null);
win3.setInitialBounds(650, 700, 450, 350);
win3.setTitle("Window 3");
win3.showTextToolbar(true);
controller.show(win3);

application.sleep(2000);
win3.toBack();
application.sleep(2000);
win1.toFront();
Table Row (tr)
classlastDetailRow
Table Cell (td) NOTE: no code is executed in Smart Client after a modal dialog is shown (the show operation blocks) until this dialog closes.ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow 
WINDOWname

WINDOW

dessIndentWindow type constant that identifies a window type. WINDOW type is the most independent type of window. It will be more accessible through the OS window manager, it can appear both in front of and under other windows and it doesn't block user interaction for other windows. In web-client windows will open in a separate browser window.ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow 

propertyservoy sDetail2100%height:30px2Property Detailscontrollername

controller

dessIndentGet the current controller from the window/dialog.ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow 
opacityname

opacity

dessIndentGets/Sets the opacity property. By default will have value 1 (completely opaque), and can be assigned to values between 0 and 1. If set then window will also be undecorated. This should be set before the dialog/window is shown, otherwise it has no effect.ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow 
resizablename

resizable

dessIndentGets/Sets whether or not this window can be resized by the user (default true).ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow 
storeBoundsname

storeBounds

dessIndentTells whether or not the bounds of this window should be stored/persisted (default false). If true, the window's bounds will be stored when the window is closed. Stored bounds will be used when the window is shown again instead of initialBounds. For non resizable windows, only location is stored/persisted.ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow 
titlename

title

dessIndentGets/Sets the title text.ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow 
transparentname

transparent

dessIndentGets/Sets the transparency property. NOTE: For smart clients, the window must be undecorated or the servoy.smartclient.allowLAFWindowDecoration property set to trueret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow 
undecoratedname

undecorated

dessIndentGets/Sets the undecorated property. If set then this window will not have any decoration and can't be moved/resized or closed. This should be set before dialog/window is shown, otherwise has no effect.ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow 

functionservoy sDetail2100%height:30px2Methods Detailsdestroyname

destroy()

dessIndentFrees the resources allocated by this window. If window is visible, it will close it first. The window will no longer be available with application.getWindow('windowName') and will no longer be usable. The main application window cannot be destroyed.ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow getHeightname

getHeight()

dessIndentReturns the height.ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow 
getNamename

getName()

dessIndentReturns the window name. It will be null in case of main application frame.ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow 
getParentname

getParent()

dessIndentReturns the parent JSWindow, if available.ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow 
getTypename

getType()

dessIndentReturns the window type.ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow 
getWidthname

getWidth()

dessIndentReturns the width.ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow 
getXname

getX()

dessIndentReturns the x coordinate.ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow 
getYname

getY()

dessIndentReturns the y coordinate.ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow 
hidename

hide()

dessIndentHides the window. It can be shown again using window.show(), controller.show() or controller.showRecords(). The main application window cannot be hidden.ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow 
isVisiblename

isVisible()

dessIndentReturns true if the window is visible, false otherwise.ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow 
resetBoundsname

resetBounds()

dessIndentDeletes the window's currently stored bounds. It will only affect the next show of the window.ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow 
setInitialBoundsname

setInitialBounds(x, y, width, height)

dessIndentSets the initial window bounds. The initial bounds are only used the first time this window is shown (what first show means depends on storeBounds property).prs

Parameters

sIndentxthe initial x coordinate of the window. Can be JSWindow.DEFAULT, JSWindow.FULL_SCREEN.ythe initial y coordinate of the window. Can be JSWindow.DEFAULT, JSWindow.FULL_SCREEN.widththe initial width of the window. Can be JSWindow.DEFAULT, JSWindow.FULL_SCREEN.heightthe initial height of the window. Can be JSWindow.DEFAULT, JSWindow.FULL_SCREEN.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow 
setLocationname

setLocation(x, y)

dessIndentSet the window location. If the coordinates are not valid they might be corrected. (for example out of screen locations)prs

Parameters

sIndentxx coordinate.yy coordinate.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow 
setSizename

setSize(width, height)

dessIndentSet the window size.prs

Parameters

sIndentwidththe width.heightthe height.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow 
showname

show(form)

dessIndentShows the given form(form name, form object or JSForm) in this window.prs

Parameters

sIndentformthe form that will be shown inside this window. It can be a form name or a form object (actual form or JSForm).
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow 
showTextToolbarname

showTextToolbar(showTextToolbar)

dessIndentSets whether or not this window should have a text tool bar. Has no effect on web client or smart client main application frame.prs

Parameters

sIndentshowTextToolbartrue if you want a text tool bar to be added to this window, false otherwise.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow 
toBackname

toBack()

dessIndentShows this window behind other windows, if possible.ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow 
toFrontname

toFront()

dessIndentBring this window in front of other windows, if possible.ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow