Table Head (thead) |
---|
Table Row (tr) |
---|
| Table Head (th) |
---|
| Method Details |
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
addClientInfo |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Adds a string of client information which gets stored on the server, and can be viewed on the Clients page of Servoy Server Administration Console. The new piece of client information is added on behalf of the running Servoy client. This function can be called more than once, if you want to add multiple lines of client information. NOTE: This function can also be used with the function <em>getClientCountForInfo</em> to count the number of clients with matching addditional client information. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} info - A line of text to be added as additional client information on behalf of the running Servoy client. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| application.addClientInfo('SaaS company name');
application.addClientInfo('For any issues call +31-SA-AS'); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Produces a "beep" sound; commonly used to indicate an error or warning dialog. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| application.beep(); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
closeAllWindows |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Close all visible windows (except main application window). Returns true if operation was successful. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Boolean - Boolean true if all windows were closed and false otherwise. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var win = application.createWindow("aWindowName", JSWindow.WINDOW, null);
win.setInitialBounds(10, 10, 300, 300);
win.title = "This is a window";
controller.show(win);
var win2 = application.createWindow("anotherWindowName", JSWindow.WINDOW, null);
win2.setInitialBounds(100, 100, 300, 300);
win2.title = "This is another window";
controller.show(win2);
var qdialog = plugins.dialogs.showQuestionDialog("QuestionDialog","Do you want to close the windows?","Yes","No");
if (qdialog == "Yes") {
application.closeAllWindows();
controller.show(null);
} |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
closeSolution |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Closes the currently open solution and optionally opens another solution, calling a specified global method with the specified arguments. If the user has been logged in, this function keeps the user logged in and in the newly open solution, the login is skipped and the solution goes straight to the first form. If you want to go to a different url, you need to call application.showURL(url) before calling application.closeSolution() (this is only applicable for Web Client). An alternative option is security.logout() which also does a log out for the user (for solutions that require authentication). |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //application.showURL('http://www.servoy.com', '_self'); //Web Client only
application.closeSolution();
//close current solution, open solution 'solution_name', call global method 'global_method_name' with argument 'my_argument'.
//if the user has been logged in, he will stay logged in
//application.closeSolution('solution_name','global_method_name','my_argument');
//Note: specifying a solution will not work in the Developer due to debugger dependencies
//specified solution should be of compatible type with client (normal type or client specific(Smart client only/Web client only) type ) |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
closeSolution |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Closes the currently open solution and optionally opens another solution, calling a specified global method with the specified arguments. If the user has been logged in, this function keeps the user logged in and in the newly open solution, the login is skipped and the solution goes straight to the first form. If you want to go to a different url, you need to call application.showURL(url) before calling application.closeSolution() (this is only applicable for Web Client). An alternative option is security.logout() which also does a log out for the user (for solutions that require authentication). |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} solutionToLoad - Name of the solution to load |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //application.showURL('http://www.servoy.com', '_self'); //Web Client only
application.closeSolution();
//close current solution, open solution 'solution_name', call global method 'global_method_name' with argument 'my_argument'.
//if the user has been logged in, he will stay logged in
//application.closeSolution('solution_name','global_method_name','my_argument');
//Note: specifying a solution will not work in the Developer due to debugger dependencies
//specified solution should be of compatible type with client (normal type or client specific(Smart client only/Web client only) type ) |
|
|
|
|
Table Body (tbody) |
---|
id | closeSolution-String_String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
closeSolution |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(solutionToLoad, methodName) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Closes the currently open solution and optionally opens another solution, calling a specified global method with the specified arguments. If the user has been logged in, this function keeps the user logged in and in the newly open solution, the login is skipped and the solution goes straight to the first form. If you want to go to a different url, you need to call application.showURL(url) before calling application.closeSolution() (this is only applicable for Web Client). An alternative option is security.logout() which also does a log out for the user (for solutions that require authentication). |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} solutionToLoad - Name of the solution to load {String} methodName - Name of the global method to call |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //application.showURL('http://www.servoy.com', '_self'); //Web Client only
application.closeSolution();
//close current solution, open solution 'solution_name', call global method 'global_method_name' with argument 'my_argument'.
//if the user has been logged in, he will stay logged in
//application.closeSolution('solution_name','global_method_name','my_argument');
//Note: specifying a solution will not work in the Developer due to debugger dependencies
//specified solution should be of compatible type with client (normal type or client specific(Smart client only/Web client only) type ) |
|
|
|
|
Table Body (tbody) |
---|
id | closeSolution-String_String_Object |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
closeSolution |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(solutionToLoad, methodName, methodArgument) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Closes the currently open solution and optionally opens another solution, calling a specified global method with the specified arguments. If the user has been logged in, this function keeps the user logged in and in the newly open solution, the login is skipped and the solution goes straight to the first form. If you want to go to a different url, you need to call application.showURL(url) before calling application.closeSolution() (this is only applicable for Web Client). An alternative option is security.logout() which also does a log out for the user (for solutions that require authentication). |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} solutionToLoad - Name of the solution to load {String} methodName - Name of the global method to call {Object} methodArgument - Argument passed to the global method |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //application.showURL('http://www.servoy.com', '_self'); //Web Client only
application.closeSolution();
//close current solution, open solution 'solution_name', call global method 'global_method_name' with argument 'my_argument'.
//if the user has been logged in, he will stay logged in
//application.closeSolution('solution_name','global_method_name','my_argument');
//Note: specifying a solution will not work in the Developer due to debugger dependencies
//specified solution should be of compatible type with client (normal type or client specific(Smart client only/Web client only) type ) |
|
|
|
|
Table Body (tbody) |
---|
id | createNewFormInstance-String_String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
| createNewFormInstance |
Span |
---|
(designFormName, newInstanceScriptName) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Create a new form instance. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} designFormName - Name of the design form {String} newInstanceScriptName - Name of the new form instance |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Boolean - Boolean (true) if the instance was created succesfully, (false) otherwise |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var ok = application.createNewFormInstance('orders','orders_view');
if (ok)
{
var dialog = application.createWindow("myDialog", JSWindow.DIALOG);
dialog.show('orders_view')
//forms['orders_view'].controller.show()
//forms.xyz.elements.myTabPanel.addTab(forms['orders_view'])
//forms['orders_view'].elements.mylabel.setLocation(10,20)
} |
|
|
|
|
Table Body (tbody) |
---|
id | createWindow-String_Number |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
createWindow |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Creates a new window that can be used for displaying forms. Initially the window is not visible. If there is already a window with the given name, it will be closed and destroyed prior to creating the new window. Use the form controller show() and showRecords() methods in order to show a form in this window. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} windowName - the name of the window. {Number} type - the type of the window. Can be one of JSWindow.DIALOG, JSWindow.MODAL_DIALOG, JSWindow.WINDOW. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| // create and show a window, with specified title, initial location and size
// type of the window can be one of JSWindow.DIALOG, JSWindow.MODAL_DIALOG, JSWindow.WINDOW
// If parentWindow is not specified, the current window will be used as parent; parentWindow parameter is only used by dialogs
var win = application.createWindow("windowName", JSWindow.WINDOW);
win.setInitialBounds(10, 10, 300, 300);
win.title = "This is a window";
controller.show(win);
// create and show a non-modal dialog with default initial bounds/title
var nmd = application.createWindow("nonModalDialogName", JSWindow.DIALOG);
controller.showRecords(15, nmd); // 15 is a single-number pk in this case |
|
|
|
|
Table Body (tbody) |
---|
id | createWindow-String_Number_JSWindow |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
createWindow |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(windowName, type, parentWindow) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Creates a new window that can be used for displaying forms. Initially the window is not visible. If there is already a window with the given name, it will be closed and destroyed prior to creating the new window. Use the form controller show() and showRecords() methods in order to show a form in this window. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} windowName - the name of the window. {Number} type - the type of the window. Can be one of JSWindow.DIALOG, JSWindow.MODAL_DIALOG, JSWindow.WINDOW. {JSWindow} parentWindow - the parent JSWindow object. If it is not specified, the current window will be used as parent. This parameter is only used by dialogs. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| // create and show a window, with specified title, initial location and size
var win = application.createWindow("windowName", JSWindow.WINDOW);
win.setInitialBounds(10, 10, 300, 300);
win.title = "This is a window";
controller.show(win);
// create and show a non-modal dialog with default initial bounds/title
var nmd = application.createWindow("nonModalDialogName", JSWindow.DIALOG);
controller.showRecords(15, nmd); // 15 is a single-number pk in this case |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
executeProgram |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Execute a program and returns output. Specify the cmd as you would do in a console. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} program - (fullpath) of the program to execute |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - The output generated by the program execution. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| // For Windows systems:
// Runs a binary located in the user's home directory. The application will run in the current working
// directory, which in general is the one where Servoy was started from.
application.executeProgram("c:\\Users\\myself\\myapp.exe", ["arg1", "arg2", "arg3"]);
// The same as above, but run the application in the user's home directory.
application.executeProgram("c:\\Users\\myself\\myapp.exe", ["arg1", "arg2", "arg3"], null, "c:\\Users\\myself\\");
// The same as above, but also set an environment variable for the called program.
application.executeProgram("c:\\Users\\myself\\myapp.exe", ["arg1", "arg2", "arg3"], ["MY_ENV_VAR=something"], "c:\\Users\\myself\\");
// For non-Windows systems:
application.executeProgram("/home/myself/myapp", ["arg1", "arg2", "arg3"]);
application.executeProgram("/home/myself/myapp", ["arg1", "arg2", "arg3"], null, "/home/myself/");
application.executeProgram("/home/myself/myapp", ["arg1", "arg2", "arg3"], ["MY_ENV_VAR=something"], "/home/myself/");
// Open a file with the default application associated with it. (on Windows)
application.executeProgram("rundll32.exe", ["url.dll,FileProtocolHandler", "filename"]);
// Open a file with the default application associated with it. (on Linux)
application.executeProgram("xdg-open", ["filename"]);
// Open a file with the default application associated with it. (on MacOS)
application.executeProgram("open", ["filename"]);
// Open a file with a specific application (on MacOS).
application.executeProgram("open", ["-a", "OpenOffice.org.app", "filename.doc"]); |
|
|
|
|
Table Body (tbody) |
---|
id | executeProgram-String_StringArray |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
executeProgram |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Execute a program and returns output. Specify the cmd as you would do in a console. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} program - (fullpath) of the program to execute {String[]} params - an array of strings as program arguments |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - The output generated by the program execution. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| // For Windows systems:
// Runs a binary located in the user's home directory. The application will run in the current working
// directory, which in general is the one where Servoy was started from.
application.executeProgram("c:\\Users\\myself\\myapp.exe", ["arg1", "arg2", "arg3"]);
// The same as above, but run the application in the user's home directory.
application.executeProgram("c:\\Users\\myself\\myapp.exe", ["arg1", "arg2", "arg3"], null, "c:\\Users\\myself\\");
// The same as above, but also set an environment variable for the called program.
application.executeProgram("c:\\Users\\myself\\myapp.exe", ["arg1", "arg2", "arg3"], ["MY_ENV_VAR=something"], "c:\\Users\\myself\\");
// For non-Windows systems:
application.executeProgram("/home/myself/myapp", ["arg1", "arg2", "arg3"]);
application.executeProgram("/home/myself/myapp", ["arg1", "arg2", "arg3"], null, "/home/myself/");
application.executeProgram("/home/myself/myapp", ["arg1", "arg2", "arg3"], ["MY_ENV_VAR=something"], "/home/myself/");
// Open a file with the default application associated with it. (on Windows)
application.executeProgram("rundll32.exe", ["url.dll,FileProtocolHandler", "filename"]);
// Open a file with the default application associated with it. (on Linux)
application.executeProgram("xdg-open", ["filename"]);
// Open a file with the default application associated with it. (on MacOS)
application.executeProgram("open", ["filename"]);
// Open a file with a specific application (on MacOS).
application.executeProgram("open", ["-a", "OpenOffice.org.app", "filename.doc"]); |
|
|
|
|
Table Body (tbody) |
---|
id | executeProgram-String_StringArray_StringArray |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
executeProgram |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(program, params, environmentVars) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Execute a program and returns output. Specify the cmd as you would do in a console. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} program - (fullpath) of the program to execute {String[]} params - an array of strings as program arguments {String[]} environmentVars - array of strings, each element of which has environment variable settings in the format name=value, or null if the subprocess should inherit the environment of the current process. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - The output generated by the program execution. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| // For Windows systems:
// Runs a binary located in the user's home directory. The application will run in the current working
// directory, which in general is the one where Servoy was started from.
application.executeProgram("c:\\Users\\myself\\myapp.exe", ["arg1", "arg2", "arg3"]);
// The same as above, but run the application in the user's home directory.
application.executeProgram("c:\\Users\\myself\\myapp.exe", ["arg1", "arg2", "arg3"], null, "c:\\Users\\myself\\");
// The same as above, but also set an environment variable for the called program.
application.executeProgram("c:\\Users\\myself\\myapp.exe", ["arg1", "arg2", "arg3"], ["MY_ENV_VAR=something"], "c:\\Users\\myself\\");
// For non-Windows systems:
application.executeProgram("/home/myself/myapp", ["arg1", "arg2", "arg3"]);
application.executeProgram("/home/myself/myapp", ["arg1", "arg2", "arg3"], null, "/home/myself/");
application.executeProgram("/home/myself/myapp", ["arg1", "arg2", "arg3"], ["MY_ENV_VAR=something"], "/home/myself/");
// Open a file with the default application associated with it. (on Windows)
application.executeProgram("rundll32.exe", ["url.dll,FileProtocolHandler", "filename"]);
// Open a file with the default application associated with it. (on Linux)
application.executeProgram("xdg-open", ["filename"]);
// Open a file with the default application associated with it. (on MacOS)
application.executeProgram("open", ["filename"]);
// Open a file with a specific application (on MacOS).
application.executeProgram("open", ["-a", "OpenOffice.org.app", "filename.doc"]); |
|
|
|
|
Table Body (tbody) |
---|
id | executeProgram-String_StringArray_StringArray_String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
executeProgram |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(program, params, environmentVars, startDir) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Execute a program and returns output. Specify the cmd as you would do in a console. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} program - (fullpath) of the program to execute {String[]} params - an array of strings as program arguments {String[]} environmentVars - array of strings, each element of which has environment variable settings in the format name=value, or null if the subprocess should inherit the environment of the current process. {String} startDir - the working directory of the subprocess, or null if the subprocess should inherit the working directory of the current process. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - The output generated by the program execution. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| // For Windows systems:
// Runs a binary located in the user's home directory. The application will run in the current working
// directory, which in general is the one where Servoy was started from.
application.executeProgram("c:\\Users\\myself\\myapp.exe", ["arg1", "arg2", "arg3"]);
// The same as above, but run the application in the user's home directory.
application.executeProgram("c:\\Users\\myself\\myapp.exe", ["arg1", "arg2", "arg3"], null, "c:\\Users\\myself\\");
// The same as above, but also set an environment variable for the called program.
application.executeProgram("c:\\Users\\myself\\myapp.exe", ["arg1", "arg2", "arg3"], ["MY_ENV_VAR=something"], "c:\\Users\\myself\\");
// For non-Windows systems:
application.executeProgram("/home/myself/myapp", ["arg1", "arg2", "arg3"]);
application.executeProgram("/home/myself/myapp", ["arg1", "arg2", "arg3"], null, "/home/myself/");
application.executeProgram("/home/myself/myapp", ["arg1", "arg2", "arg3"], ["MY_ENV_VAR=something"], "/home/myself/");
// Open a file with the default application associated with it. (on Windows)
application.executeProgram("rundll32.exe", ["url.dll,FileProtocolHandler", "filename"]);
// Open a file with the default application associated with it. (on Linux)
application.executeProgram("xdg-open", ["filename"]);
// Open a file with the default application associated with it. (on MacOS)
application.executeProgram("open", ["filename"]);
// Open a file with a specific application (on MacOS).
application.executeProgram("open", ["-a", "OpenOffice.org.app", "filename.doc"]); |
|
|
|
|
Table Body (tbody) |
---|
id | executeProgramInBackground-String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
executeProgramInBackground |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
| executeProgramInBackground |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Execute a program in the background. Specify the cmd as you would do in a console. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} program - (fullpath) of the program to execute |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| // For Windows systems:
// Runs a binary located in the user's home directory. The application will run in the current working
// directory, which in general is the one where Servoy was started from.
application.executeProgramInBackground("c:\\Users\\myself\\myapp.exe", ["arg1", "arg2", "arg3"]);
// The same as above, but run the application in the user's home directory.
application.executeProgramInBackground("c:\\Users\\myself\\myapp.exe", ["arg1", "arg2", "arg3"], null, "c:\\Users\\myself\\");
// The same as above, but also set an environment variable for the called program.
application.executeProgramInBackground("c:\\Users\\myself\\myapp.exe", ["arg1", "arg2", "arg3"], ["MY_ENV_VAR=something"], "c:\\Users\\myself\\");
// For non-Windows systems:
application.executeProgramInBackground("/home/myself/myapp", ["arg1", "arg2", "arg3"]);
application.executeProgramInBackground("/home/myself/myapp", ["arg1", "arg2", "arg3"], null, "/home/myself/");
application.executeProgramInBackground("/home/myself/myapp", ["arg1", "arg2", "arg3"], ["MY_ENV_VAR=something"], "/home/myself/");
// Open a file with the default application associated with it. (on Windows)
application.executeProgramInBackground("rundll32.exe", ["url.dll,FileProtocolHandler", "filename"]);
// Open a file with the default application associated with it. (on Linux)
application.executeProgramInBackground("xdg-open", ["filename"]);
// Open a file with the default application associated with it. (on MacOS)
application.executeProgramInBackground("open", ["filename"]);
// Open a file with a specific application (on MacOS).
application.executeProgram("open", ["-a", "OpenOffice.org.app", "filename.doc"]); |
|
|
|
|
Table Body (tbody) |
---|
id | executeProgramInBackground-String_StringArray |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
executeProgramInBackground |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
| executeProgramInBackground |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Execute a program in the background. Specify the cmd as you would do in a console. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} program - (fullpath) of the program to execute {String[]} params - an array of strings as program arguments |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| // For Windows systems:
// Runs a binary located in the user's home directory. The application will run in the current working
// directory, which in general is the one where Servoy was started from.
application.executeProgramInBackground("c:\\Users\\myself\\myapp.exe", ["arg1", "arg2", "arg3"]);
// The same as above, but run the application in the user's home directory.
application.executeProgramInBackground("c:\\Users\\myself\\myapp.exe", ["arg1", "arg2", "arg3"], null, "c:\\Users\\myself\\");
// The same as above, but also set an environment variable for the called program.
application.executeProgramInBackground("c:\\Users\\myself\\myapp.exe", ["arg1", "arg2", "arg3"], ["MY_ENV_VAR=something"], "c:\\Users\\myself\\");
// For non-Windows systems:
application.executeProgramInBackground("/home/myself/myapp", ["arg1", "arg2", "arg3"]);
application.executeProgramInBackground("/home/myself/myapp", ["arg1", "arg2", "arg3"], null, "/home/myself/");
application.executeProgramInBackground("/home/myself/myapp", ["arg1", "arg2", "arg3"], ["MY_ENV_VAR=something"], "/home/myself/");
// Open a file with the default application associated with it. (on Windows)
application.executeProgramInBackground("rundll32.exe", ["url.dll,FileProtocolHandler", "filename"]);
// Open a file with the default application associated with it. (on Linux)
application.executeProgramInBackground("xdg-open", ["filename"]);
// Open a file with the default application associated with it. (on MacOS)
application.executeProgramInBackground("open", ["filename"]);
// Open a file with a specific application (on MacOS).
application.executeProgram("open", ["-a", "OpenOffice.org.app", "filename.doc"]); |
|
|
|
|
Table Body (tbody) |
---|
id | executeProgramInBackground-String_StringArray_StringArray |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
executeProgramInBackground |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
| executeProgramInBackground |
Span |
---|
(program, params, environmentVars) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Execute a program in the background. Specify the cmd as you would do in a console. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} program - (fullpath) of the program to execute {String[]} params - an array of strings as program arguments {String[]} environmentVars - array of strings, each element of which has environment variable settings in the format name=value, or null if the subprocess should inherit the environment of the current process. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| // For Windows systems:
// Runs a binary located in the user's home directory. The application will run in the current working
// directory, which in general is the one where Servoy was started from.
application.executeProgramInBackground("c:\\Users\\myself\\myapp.exe", ["arg1", "arg2", "arg3"]);
// The same as above, but run the application in the user's home directory.
application.executeProgramInBackground("c:\\Users\\myself\\myapp.exe", ["arg1", "arg2", "arg3"], null, "c:\\Users\\myself\\");
// The same as above, but also set an environment variable for the called program.
application.executeProgramInBackground("c:\\Users\\myself\\myapp.exe", ["arg1", "arg2", "arg3"], ["MY_ENV_VAR=something"], "c:\\Users\\myself\\");
// For non-Windows systems:
application.executeProgramInBackground("/home/myself/myapp", ["arg1", "arg2", "arg3"]);
application.executeProgramInBackground("/home/myself/myapp", ["arg1", "arg2", "arg3"], null, "/home/myself/");
application.executeProgramInBackground("/home/myself/myapp", ["arg1", "arg2", "arg3"], ["MY_ENV_VAR=something"], "/home/myself/");
// Open a file with the default application associated with it. (on Windows)
application.executeProgramInBackground("rundll32.exe", ["url.dll,FileProtocolHandler", "filename"]);
// Open a file with the default application associated with it. (on Linux)
application.executeProgramInBackground("xdg-open", ["filename"]);
// Open a file with the default application associated with it. (on MacOS)
application.executeProgramInBackground("open", ["filename"]);
// Open a file with a specific application (on MacOS).
application.executeProgram("open", ["-a", "OpenOffice.org.app", "filename.doc"]); |
|
|
|
|
Table Body (tbody) |
---|
id | executeProgramInBackground-String_StringArray_StringArray_String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
executeProgramInBackground |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
| executeProgramInBackground |
Span |
---|
(program, params, environmentVars, startDir) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Execute a program in the background. Specify the cmd as you would do in a console. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} program - (fullpath) of the program to execute {String[]} params - an array of strings as program arguments {String[]} environmentVars - array of strings, each element of which has environment variable settings in the format name=value, or null if the subprocess should inherit the environment of the current process. {String} startDir - the working directory of the subprocess, or null if the subprocess should inherit the working directory of the current process. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| // For Windows systems:
// Runs a binary located in the user's home directory. The application will run in the current working
// directory, which in general is the one where Servoy was started from.
application.executeProgramInBackground("c:\\Users\\myself\\myapp.exe", ["arg1", "arg2", "arg3"]);
// The same as above, but run the application in the user's home directory.
application.executeProgramInBackground("c:\\Users\\myself\\myapp.exe", ["arg1", "arg2", "arg3"], null, "c:\\Users\\myself\\");
// The same as above, but also set an environment variable for the called program.
application.executeProgramInBackground("c:\\Users\\myself\\myapp.exe", ["arg1", "arg2", "arg3"], ["MY_ENV_VAR=something"], "c:\\Users\\myself\\");
// For non-Windows systems:
application.executeProgramInBackground("/home/myself/myapp", ["arg1", "arg2", "arg3"]);
application.executeProgramInBackground("/home/myself/myapp", ["arg1", "arg2", "arg3"], null, "/home/myself/");
application.executeProgramInBackground("/home/myself/myapp", ["arg1", "arg2", "arg3"], ["MY_ENV_VAR=something"], "/home/myself/");
// Open a file with the default application associated with it. (on Windows)
application.executeProgramInBackground("rundll32.exe", ["url.dll,FileProtocolHandler", "filename"]);
// Open a file with the default application associated with it. (on Linux)
application.executeProgramInBackground("xdg-open", ["filename"]);
// Open a file with the default application associated with it. (on MacOS)
application.executeProgramInBackground("open", ["filename"]);
// Open a file with a specific application (on MacOS).
application.executeProgram("open", ["-a", "OpenOffice.org.app", "filename.doc"]); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Stop and exit application. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| // exit application
application.exit(); |
|
|
|
|
Table Body (tbody) |
---|
id | getActiveClientCount-Boolean |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getActiveClientCount |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(currentSolutionOnly) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get the active user count on the server (can be limited to current solution). |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {Boolean} currentSolutionOnly - Boolean (true) to get the active user count on server only to the current solution |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Number - Active user count on the server |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var count = application.getActiveClientCount(true); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getActiveWindow |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| This gets the currently focused active window; this can be the main application window or a modal dialog. For a webclient getWindow() can return the main window that is not really the main for the current tab in the browser that can return the previous tab that a user could have opened. For this method is better suited because this will give you the actual tab in the browser. Another call would be form.controller.getWindow() of a form that you know in which window it resides. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| JSWindow - the current active/focussed window. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| // get the currently active/focused window or dialog
var activeWindow = application.getActiveWindow(); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getApplicationType |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get the application type. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Number - Constant application type |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var type = application.getApplicationType();
//see application type contstant |
|
|
|
|
Table Body (tbody) |
---|
id | getClientCountForInfo-String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getClientCountForInfo |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
| getClientCountForInfo |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Gets the count for all clients displaying the same additional information in the Clients page of Servoy Server Administration Console. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} info - The additional client info string to search for. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var count = application.getClientCountForInfo('SaaS company name');
application.output('Including yourself, there are ' + count + ' client(s) running on behalf of the company.'); |
|
|
|
|
Table Body (tbody) |
---|
id | getClientProperty-Object |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getClientProperty |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {Object} name - Name of the client property |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Object - the property value for the given name/key, null of nothing was found |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //Only use this function from the solution on open method!
//In smart client, use this to set javax.swing.UIDefaults properties.
application.putClientProperty('ToolTip.hideAccelerator', true)
//To change the comboboxes selection background color, do this:
application.putClientProperty('ComboBox.selectionBackground', new Packages.javax.swing.plaf.ColorUIResource(java.awt.Color.RED))
//In web client, use this to change the template directory.
//To change the default dir of templates/default to templates/green_skin, do this:
application.putClientProperty('templates.dir','green_skin'); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getClipboardString |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Gets a string from the clipboard, null if not a string or empty. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - The string from the clipboard |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var fromClipboard = application.getClipboardString(); |
|
|
|
|
Table Body (tbody) |
---|
id | getCurrentLookAndFeelName |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getCurrentLookAndFeelName |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
| getCurrentLookAndFeelName |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Gets the name of the current Look And Feel specified in Application Preferences. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - Current Look And Feel |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var laf = application.getCurrentLookAndFeelName(); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getHostName |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get the name of the localhost. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - Name of the localhost |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var hostName = application.getHostName(); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getIPAddress |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get the clients' IP address. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - IP address of the client |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var ip = application.getIPAddress(); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getLicenseNames |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get the names of the used client licenses (as strings in array). |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String[] - Client licenses names |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var array = application.getLicenseNames(); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Returns the name of the operating system. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - Name of the operating system |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var osname = application.getOSName(); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getPrinters |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get all the printer names in an array. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String[] - All printer names |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var printersArray = application.getPrinters(); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getScreenHeight |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get the screen height in pixels. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var height = application.getScreenHeight(); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getScreenWidth |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get the screen width in pixels. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var width = application.getScreenWidth(); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getServerTimeStamp |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Returns a date object initialized on server with current date and time. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var servertime = application.getServerTimeStamp(); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getServerURL |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Gets the HTTP server url. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var url = application.getServerURL(); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getSolutionName |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Returns the name of the current solution. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - Current solution name |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var solutionName = application.getSolutionName(); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getSolutionRelease |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get the solution release number. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Number - Current solution release number |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var release = application.getSolutionRelease(); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getTimeStamp |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Returns a date object initialized in client with current date and time. This should be used instead of new Date() for webclients when the clients are in different times zones then the server. Then this call will really return a time that is the locals webclients time. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Date - Current time at the client |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var clienttime = application.getTimeStamp(); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get a new UUID object (also known as GUID) or convert the parameter (that can be string or byte array) to an UUID object. A table column marked as UUID will work with such objects. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| UUID - The new UUID object |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var new_uuid_object = application.getUUID(); // generate new uuid object
var uuid_object1 = application.getUUID(new_uuid_object.toString()); // convert a string representing an uuid to an uuid object
var uuid_object2 = application.getUUID(new_uuid_object.toBytes()); // convert a byte array representing an uuid to an uuid object |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get a new UUID object (also known as GUID) or convert the parameter (that can be string or byte array) to an UUID object. A table column marked as UUID will work with such objects. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {byte[]} byteArray - Byte array representing an uuid |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| UUID - The new UUID object |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var new_uuid_object = application.getUUID(); // generate new uuid object
var uuid_object1 = application.getUUID(new_uuid_object.toString()); // convert a string representing an uuid to an uuid object
var uuid_object2 = application.getUUID(new_uuid_object.toBytes()); // convert a byte array representing an uuid to an uuid object |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get a new UUID object (also known as GUID) or convert the parameter (that can be string or byte array) to an UUID object. A table column marked as UUID will work with such objects. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} uuidString - String representing an uuid |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| UUID - The new UUID object |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var new_uuid_object = application.getUUID(); // generate new uuid object
var uuid_object1 = application.getUUID(new_uuid_object.toString()); // convert a string representing an uuid to an uuid object
var uuid_object2 = application.getUUID(new_uuid_object.toBytes()); // convert a byte array representing an uuid to an uuid object |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getUserProperty |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get a persistent user property. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} name - Name of the property |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var value = application.getUserProperty('showOrders'); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getUserPropertyNames |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get all persistent user property names. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String[] - Array of all user property names |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| // display all user properties
allPropertyNames = application.getUserPropertyNames();
for(var i = 0; i < allPropertyNames.length; i++)
{
application.output(allPropertyNames[i] + " = " + application.getUserProperty(allPropertyNames[i]));
} |
|
|
|
|
Table Body (tbody) |
---|
id | getValueListArray-String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getValueListArray |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Retrieve a valuelist as array, to get real-values for display-values. NOTE: this doesn't return a value for a valuelist that depends on a database relation or is a global method valuelist. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} name - The name of the valuelist |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Array - Named array for the valuelist |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var packet_types = application.getValueListArray('packet_types');
if (a_realValue == packet_types['displayValue'])
{
} |
|
|
|
|
Table Body (tbody) |
---|
id | getValueListDisplayValue-String_Object |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getValueListDisplayValue |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
| getValueListDisplayValue |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Retrieve a valuelist display-value for a real-value. NOTE: this doesn't return a value for a valuelist that depends on a database relation or is a global method valuelist. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} name - Name of the valuelist {Object} realValue - Real value of the valuelist |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Object - Display value of the real value from the valuelist |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var displayable_status = application.getValueListDisplayValue('case_status',status); |
|
|
|
|
Table Body (tbody) |
---|
id | getValueListItems-String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getValueListItems |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get all values from a custom or database type value list as dataset (with columns displayValue,realValue). NOTE: this doesn't return a value for a valuelist that depends on a database relation or is a global method valuelist. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} name - Name of the valuelist |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| JSDataSet - DataSet with valuelist's display values and real values |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //Note:see databaseManager.JSDataSet for full details of dataset
var dataset = application.getValueListItems('my_en_types');
//example to calc a strange total
global_total = 0;
for( var i = 1 ; i <= dataset.getMaxRowIndex() ; i++ )
{
global_total = global_total + dataset.getValue(i,1);
}
//example to assign to dataprovider
//employee_salary = dataset.getValue(1,1) |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getValueListNames |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get all the valuelist names as array. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String[] - Array with all valuelist names |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var array = application.getValueListNames(); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getVersion |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Returns the application version. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - Application version |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| application.getVersion(); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get the main application window. This is the window that is created first for this client. In a smart client this is always just the first started window where the solution is loaded in. In a webclient when users (so not the developer through a createWindow() call) create there own tabs after In a webclient the user may open the same solution in a new tab in the same browser. In that case the main solution window will always be the first opened tab, even if that one was already closed. application.getActiveWindow() will aways return the currently active/focused window or dialog. If you need the window of the current top-level form, controller.getWindow() of that form will always return the correct window. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| JSWindow - the main application JSWindow. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| // close and dispose window resources
var mainAppWindow = application.getWindow(); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get a window by window name. When not supplying a name, the main application window is grabbed. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} name - the name of the window. If not specified, the main application JSWindow will be returned. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| JSWindow - the JSWindow with the specified name, or null if no such window exists. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| // close and dispose window resources
var win = application.getWindow("someWindowName");
if (win != null) {
win.destroy();
} |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
isInDeveloper |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Returns true if the solution is running in the developer. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Boolean - Boolean (true) if the solution is running in the developer, (false) otherwise |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var flag = application.isInDeveloper(); |
|
|
|
|
Table Body (tbody) |
---|
id | isLastPrintPreviewPrinted |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
isLastPrintPreviewPrinted |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
| isLastPrintPreviewPrinted |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Check if the last printpreview did print. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Boolean - Boolean (true) is the last print preview did print, (false) otherwise |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //attached this method to onShow on the form being shown after printpreview
//set a global called scopes.globals.showPrintPreview to 1 in the onPrintPreview method
if (scopes.globals.showPrintPreview == 1)
{
scopes.globals.showPrintPreview = 0;//clear for next time
if (application.isLastPrintPreviewPrinted())
{
plugins.dialogs.showInfoDialog('Alert', 'There is printed in printpreview', 'OK')
}
} |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Output something on the out stream. (if running in debugger view output console tab) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {Object} msg - Object to send to output stream |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| // log level is used to determine how/if to log in servoy_log.txt; for smart client java out and err streams are used
application.output('my very important trace msg');// default log level: info |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Output something on the out stream. (if running in debugger view output console tab) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {Object} msg - Object to send to output stream {Number} level - the log level where it should log to. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| // log level is used to determine how/if to log in servoy_log.txt; for smart client java out and err streams are used
application.output('my very important msg',LOGGINGLEVEL.ERROR);// log level: error |
|
|
|
|
Table Body (tbody) |
---|
id | overrideStyle-String_String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
overrideStyle |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(originalStyleName, newStyleName) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Overrides one style (defined in in a form) with another. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} originalStyleName - Name of the style to override {String} newStyleName - Name of the new style |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //This function will only have effect on forms not yet created, so solution onLoad is the best place to override'
//For example overriding the use of default/designed style anywhere in the solution from 'mystyle' to 'mystyle_mac'
application.overrideStyle('mystyle','mystyle_mace')//in this case both styles should have about the same classes |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Play a sound (AU file, an AIFF file, a WAV file, and a MIDI file). |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} url - URL of the sound file |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| application.playSound('media:///click.wav'); |
|
|
|
|
Table Body (tbody) |
---|
id | putClientProperty-Object_Object |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
putClientProperty |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {Object} name - Name of the client property {Object} value - New value of the client property |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Boolean - Boolean (true) if the client property was set with the new value |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //Only use this function from the solution on open method!
//In smart client, use this to set javax.swing.UIDefaults properties.
application.putClientProperty('ToolTip.hideAccelerator', true)
//To change the comboboxes selection background color, do this:
application.putClientProperty('ComboBox.selectionBackground', new Packages.javax.swing.plaf.ColorUIResource(java.awt.Color.RED))
//In web client, use this to change the template directory.
//To change the default dir of templates/default to templates/green_skin, do this:
application.putClientProperty('templates.dir','green_skin'); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Redo last action (if possible). |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| application.redo(); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
removeAllClientInfo |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Removes all names given to the client via the admin page. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| application.removeAllClientInfo(); |
|
|
|
|
Table Body (tbody) |
---|
id | removeClientInfo-String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
removeClientInfo |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Removes a string of client information which is stored on the server and previously was added using the application.addClientInfo('client info') This function can be called more than once, if you want to delete multiple lines of client information. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} info - A line of text to be removed from the client information on behalf of the running Servoy client. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Boolean - boolean indicator if info was removed successfully |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var removed = application.removeClientInfo('SaaS company name'); |
|
|
|
|
Table Body (tbody) |
---|
id | setClipboardContent-Object |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
setClipboardContent |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Sets a string object in the clipboard. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {Object} string - New content of the clipboard |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| application.setClipboardContent('test'); |
|
|
|
|
Table Body (tbody) |
---|
id | setNumpadEnterAsFocusNextEnabled-Boolean |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
setNumpadEnterAsFocusNextEnabled |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
| setNumpadEnterAsFocusNextEnabled |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Set if numpad enter should behave like focus next. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {Boolean} enabled - Boolean (true) if numpad enter should behave like focus next |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| application.setNumpadEnterAsFocusNextEnabled(true); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
setStatusText |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Set the status area value. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} text - New status text |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| application.setStatusText('Your status text'); |
|
|
|
|
Table Body (tbody) |
---|
id | setStatusText-String_String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
setStatusText |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Set the status area value. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} text - New status text {String} tooltip - Status tooltip text |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| application.setStatusText('Your status text','Your status tooltip text'); |
|
|
|
|
Table Body (tbody) |
---|
id | setToolbarVisible-String_Boolean |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Make a toolbar visible or invisible. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} name - Name of the toolbar {Boolean} visible - Visibility of the toolbar |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //example: hide the text toolbar
application.setToolbarVisible('text',false); |
|
|
|
|
Table Body (tbody) |
---|
id | setUserProperty-String_String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
setUserProperty |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Sets a user property for this client: <br> For heedless clients((including Batch Processors and Authentication clients) the user property is stored in memory and will be lost upon client restart. <br> For Web client the user property will be stored in a persistent cookie <br> For Smart Client it will be stored in client local properties file |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} name - Name of the user property {String} value - New value of the user property |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| application.setUserProperty('showOrders','1'); |
|
|
|
|
Table Body (tbody) |
---|
id | setValueListItems-String_JSDataSet |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
setValueListItems |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Fill a custom type valuelist with values from array(s) or dataset. NOTE: if you modify values for checkbox/radio field, note that having one value in valuelist is a special case, so switching between one value and 0/multiple values after form is created may have side effects |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} name - Name of the valuelist {JSDataSet} dataset - Dataset with display/real values |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //set display values (return values will be same as display values)
application.setValueListItems('my_en_types',new Array('Item 1', 'Item 2', 'Item 3'));
//set display values and return values (which are stored in dataprovider)
//application.setValueListItems('my_en_types',new Array('Item 1', 'Item 2', 'Item 3'),new Array(10000,10010,10456));
//set display values and return values converted to numbers
//application.setValueListItems('my_en_types',new Array('Item 1', 'Item 2', 'Item 3'),new Array('10000','10010', '10456'), true);
//do query and fill valuelist (see databaseManager for full details of queries/dataset)
//var query = 'select display_value,optional_real_value from test_table';
//var dataset = databaseManager.getDataSetByQuery(databaseManager.getDataSourceServerName(controller.getDataSource()), query, null, 25);
//application.setValueListItems('my_en_types',dataset); |
|
|
|
|
Table Body (tbody) |
---|
id | setValueListItems-String_JSDataSet_Boolean |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
setValueListItems |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(name, dataset, autoconvert) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Fill a custom type valuelist with values from array(s) or dataset. NOTE: if you modify values for checkbox/radio field, note that having one value in valuelist is a special case, so switching between one value and 0/multiple values after form is created may have side effects |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} name - Name of the valuelist {JSDataSet} dataset - Dataset with display/real values {Boolean} autoconvert - Boolean (true) if display values and return values should be converted to numbers |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //set display values (return values will be same as display values)
application.setValueListItems('my_en_types',new Array('Item 1', 'Item 2', 'Item 3'));
//set display values and return values (which are stored in dataprovider)
//application.setValueListItems('my_en_types',new Array('Item 1', 'Item 2', 'Item 3'),new Array(10000,10010,10456));
//set display values and return values converted to numbers
//application.setValueListItems('my_en_types',new Array('Item 1', 'Item 2', 'Item 3'),new Array('10000','10010', '10456'), true);
//do query and fill valuelist (see databaseManager for full details of queries/dataset)
//var query = 'select display_value,optional_real_value from test_table';
//var dataset = databaseManager.getDataSetByQuery(databaseManager.getDataSourceServerName(controller.getDataSource()), query, null, 25);
//application.setValueListItems('my_en_types',dataset); |
|
|
|
|
Table Body (tbody) |
---|
id | setValueListItems-String_ObjectArray |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
setValueListItems |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(name, displayValues) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Fill a custom type valuelist with values from array(s) or dataset. NOTE: if you modify values for checkbox/radio field, note that having one value in valuelist is a special case, so switching between one value and 0/multiple values after form is created may have side effects |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} name - Name of the valuelist {Object[]} displayValues - Display values array |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //set display values (return values will be same as display values)
application.setValueListItems('my_en_types',new Array('Item 1', 'Item 2', 'Item 3'));
//set display values and return values (which are stored in dataprovider)
//application.setValueListItems('my_en_types',new Array('Item 1', 'Item 2', 'Item 3'),new Array(10000,10010,10456));
//set display values and return values converted to numbers
//application.setValueListItems('my_en_types',new Array('Item 1', 'Item 2', 'Item 3'),new Array('10000','10010', '10456'), true);
//do query and fill valuelist (see databaseManager for full details of queries/dataset)
//var query = 'select display_value,optional_real_value from test_table';
//var dataset = databaseManager.getDataSetByQuery(databaseManager.getDataSourceServerName(controller.getDataSource()), query, null, 25);
//application.setValueListItems('my_en_types',dataset); |
|
|
|
|
Table Body (tbody) |
---|
id | setValueListItems-String_ObjectArray_Boolean |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
setValueListItems |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(name, displayValues, autoconvert) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Fill a custom type valuelist with values from array(s) or dataset. NOTE: if you modify values for checkbox/radio field, note that having one value in valuelist is a special case, so switching between one value and 0/multiple values after form is created may have side effects |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} name - Name of the valuelist {Object[]} displayValues - Display values array {Boolean} autoconvert - Boolean (true) if display values and return values should be converted to numbers |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //set display values (return values will be same as display values)
application.setValueListItems('my_en_types',new Array('Item 1', 'Item 2', 'Item 3'));
//set display values and return values (which are stored in dataprovider)
//application.setValueListItems('my_en_types',new Array('Item 1', 'Item 2', 'Item 3'),new Array(10000,10010,10456));
//set display values and return values converted to numbers
//application.setValueListItems('my_en_types',new Array('Item 1', 'Item 2', 'Item 3'),new Array('10000','10010', '10456'), true);
//do query and fill valuelist (see databaseManager for full details of queries/dataset)
//var query = 'select display_value,optional_real_value from test_table';
//var dataset = databaseManager.getDataSetByQuery(databaseManager.getDataSourceServerName(controller.getDataSource()), query, null, 25);
//application.setValueListItems('my_en_types',dataset); |
|
|
|
|
Table Body (tbody) |
---|
id | setValueListItems-String_ObjectArray_ObjectArray |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
setValueListItems |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(name, displayValues, realValues) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Fill a custom type valuelist with values from array(s) or dataset. NOTE: if you modify values for checkbox/radio field, note that having one value in valuelist is a special case, so switching between one value and 0/multiple values after form is created may have side effects |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} name - Name of the valuelist {Object[]} displayValues - Display values array {Object[]} realValues - Real values array |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //set display values (return values will be same as display values)
application.setValueListItems('my_en_types',new Array('Item 1', 'Item 2', 'Item 3'));
//set display values and return values (which are stored in dataprovider)
//application.setValueListItems('my_en_types',new Array('Item 1', 'Item 2', 'Item 3'),new Array(10000,10010,10456));
//set display values and return values converted to numbers
//application.setValueListItems('my_en_types',new Array('Item 1', 'Item 2', 'Item 3'),new Array('10000','10010', '10456'), true);
//do query and fill valuelist (see databaseManager for full details of queries/dataset)
//var query = 'select display_value,optional_real_value from test_table';
//var dataset = databaseManager.getDataSetByQuery(databaseManager.getDataSourceServerName(controller.getDataSource()), query, null, 25);
//application.setValueListItems('my_en_types',dataset); |
|
|
|
|
Table Body (tbody) |
---|
id | setValueListItems-String_ObjectArray_ObjectArray_Boolean |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
setValueListItems |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(name, displayValues, realValues, autoconvert) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Fill a custom type valuelist with values from array(s) or dataset. NOTE: if you modify values for checkbox/radio field, note that having one value in valuelist is a special case, so switching between one value and 0/multiple values after form is created may have side effects |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} name {Object[]} displayValues - Display values array {Object[]} realValues - Real values array {Boolean} autoconvert - Boolean (true) if display values and return values should be converted to numbers |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //set display values (return values will be same as display values)
application.setValueListItems('my_en_types',new Array('Item 1', 'Item 2', 'Item 3'));
//set display values and return values (which are stored in dataprovider)
//application.setValueListItems('my_en_types',new Array('Item 1', 'Item 2', 'Item 3'),new Array(10000,10010,10456));
//set display values and return values converted to numbers
//application.setValueListItems('my_en_types',new Array('Item 1', 'Item 2', 'Item 3'),new Array('10000','10010', '10456'), true);
//do query and fill valuelist (see databaseManager for full details of queries/dataset)
//var query = 'select display_value,optional_real_value from test_table';
//var dataset = databaseManager.getDataSetByQuery(databaseManager.getDataSourceServerName(controller.getDataSource()), query, null, 25);
//application.setValueListItems('my_en_types',dataset); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
showCalendar |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Show the calendar, returns selected date or null if canceled. Initial value and date format can be also specified. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Date - Selected date or null if canceled |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var selectedDate = application.showCalendar(); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
showCalendar |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Show the calendar, returns selected date or null if canceled. Initial value and date format can be also specified. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} dateFormat - Date format |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Date - Selected date or null if canceled |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var selectedDate = application.showCalendar(); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
showCalendar |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Show the calendar, returns selected date or null if canceled. Initial value and date format can be also specified. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {Date} selectedDate - Default selected date |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Date - Selected date or null if canceled |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var selectedDate = application.showCalendar(); |
|
|
|
|
Table Body (tbody) |
---|
id | showCalendar-Date_String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
showCalendar |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(selectedDate, dateFormat) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Show the calendar, returns selected date or null if canceled. Initial value and date format can be also specified. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {Date} selectedDate - Default selected date {String} dateFormat - Date format |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Date - Selected date or null if canceled |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var selectedDate = application.showCalendar(); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
showColorChooser |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Show the colorChooser. Returned value is in format #RRGGBB or null if canceled. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - selected color or null if canceled |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var selectedColor = application.showColorChooser(); |
|
|
|
|
Table Body (tbody) |
---|
id | showColorChooser-String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
showColorChooser |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Show the colorChooser. Returned value is in format #RRGGBB or null if canceled. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} colorString - Default color |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - selected color or null if canceled |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var selectedColor = application.showColorChooser(); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
showFontChooser |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Show the font chooser dialog. Returns the selected font. Can specify a default font. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var selectedFont = application.showFontChooser();
elements.myfield.font = selectedFont |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
showFontChooser |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Show the font chooser dialog. Returns the selected font. Can specify a default font. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} defaultFont - Default font |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var selectedFont = application.showFontChooser();
elements.myfield.font = selectedFont |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Show the form specified by the parameter, that can be a name (is case sensitive!) or a form object. This will show the form in the active/currently focused window. So when called from a form in a dialog the dialog will show the form. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {Object} form - Form object or name |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| application.showForm('MyForm'); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
showI18NDialog |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Opens the i18n dialog so users can change translations. Returns the key selected by the user (not it's translation) or null if cancel is pressed. Optional parameters specify the initial selections in the dialog. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - selected I18N key or null if cancel is pressed |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| application.showI18NDialog("servoy.button.close", "en"); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
showI18NDialog |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Opens the i18n dialog so users can change translations. Returns the key selected by the user (not it's translation) or null if cancel is pressed. Optional parameters specify the initial selections in the dialog. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} keyToSelect - Default selected key |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - selected I18N key or null if cancel is pressed |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| application.showI18NDialog("servoy.button.close", "en"); |
|
|
|
|
Table Body (tbody) |
---|
id | showI18NDialog-String_String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
showI18NDialog |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(keyToSelect, languageToSelect) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Opens the i18n dialog so users can change translations. Returns the key selected by the user (not it's translation) or null if cancel is pressed. Optional parameters specify the initial selections in the dialog. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} keyToSelect - Default selected key {String} languageToSelect - Default selected language |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - selected I18N key or null if cancel is pressed |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| application.showI18NDialog("servoy.button.close", "en"); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Shows an URL in a browser. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Boolean - Boolean (true) if URL was shown |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| application.showURL('http://www.example.com');
//webclient specific additional parameters...
//2nd parameter: target frame or named dialog/window, so its possible to control in which (internal) frame or dialog the url is loaded, '_self' is current window,'_blank' is new dialog, '_top' is main window
//3rd parameter: dialog options used when a dialog is specified, example: 'height=200,width=400,status=yes,toolbar=no,menubar=no,location=no'
//3rd or 4th parameter: a timeout in seconds when the url should be shown, immediately/0 is default' |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(url, webclientTarget) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Shows an URL in a browser. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} url - URL to show {String} webclientTarget - Target frame or named dialog/window |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Boolean - Boolean (true) if URL was shown |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| application.showURL('http://www.example.com');
//webclient specific additional parameters...
//2nd parameter: target frame or named dialog/window, so its possible to control in which (internal) frame or dialog the url is loaded, '_self' is current window,'_blank' is new dialog, '_top' is main window
//3rd parameter: dialog options used when a dialog is specified, example: 'height=200,width=400,status=yes,toolbar=no,menubar=no,location=no'
//3rd or 4th parameter: a timeout in seconds when the url should be shown, immediately/0 is default' |
|
|
|
|
Table Body (tbody) |
---|
id | showURL-String_String_Number |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(url, webclientTarget, timeout) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Shows an URL in a browser. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} url - URL to show {String} webclientTarget - Target frame or named dialog/window {Number} timeout - A timeout in seconds when the url should be shown |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Boolean - Boolean (true) if URL was shown |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| application.showURL('http://www.example.com');
//webclient specific additional parameters...
//2nd parameter: target frame or named dialog/window, so its possible to control in which (internal) frame or dialog the url is loaded, '_self' is current window,'_blank' is new dialog, '_top' is main window
//3rd parameter: dialog options used when a dialog is specified, example: 'height=200,width=400,status=yes,toolbar=no,menubar=no,location=no'
//3rd or 4th parameter: a timeout in seconds when the url should be shown, immediately/0 is default' |
|
|
|
|
Table Body (tbody) |
---|
id | showURL-String_String_String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(url, webclientTarget, webclientTargetOptions) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Shows an URL in a browser. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} url - URL to show {String} webclientTarget - Target frame or named dialog/window {String} webclientTargetOptions - Dialog options used when a dialog is specified / a timeout in seconds when the url should be shown |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Boolean - Boolean (true) if URL was shown |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| application.showURL('http://www.example.com');
//webclient specific additional parameters...
//2nd parameter: target frame or named dialog/window, so its possible to control in which (internal) frame or dialog the url is loaded, '_self' is current window,'_blank' is new dialog, '_top' is main window
//3rd parameter: dialog options used when a dialog is specified, example: 'height=200,width=400,status=yes,toolbar=no,menubar=no,location=no'
//3rd or 4th parameter: a timeout in seconds when the url should be shown, immediately/0 is default' |
|
|
|
|
Table Body (tbody) |
---|
id | showURL-String_String_String_Number |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(url, webclientTarget, webclientTargetOptions, timeout) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Shows an URL in a browser. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} url - URL to show {String} webclientTarget - Target frame or named dialog/window {String} webclientTargetOptions - Dialog options used when a dialog is specified / a timeout in seconds when the url should be shown {Number} timeout - A timeout in seconds when the url should be shown |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Boolean - Boolean (true) if URL was shown |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| application.showURL('http://www.example.com');
//webclient specific additional parameters...
//2nd parameter: target frame or named dialog/window, so its possible to control in which (internal) frame or dialog the url is loaded, '_self' is current window,'_blank' is new dialog, '_top' is main window
//3rd parameter: dialog options used when a dialog is specified, example: 'height=200,width=400,status=yes,toolbar=no,menubar=no,location=no'
//3rd or 4th parameter: a timeout in seconds when the url should be shown, immediately/0 is default' |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Sleep for specified time (in milliseconds). |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {Number} ms - Sleep time in milliseconds |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //Sleep for 3 seconds
application.sleep(3000); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Undo last action (if possible). |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| application.undo(); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {Number} milliseconds - How long the update should take in milliseconds |
|
|
|
|