Application
(application)
Overview
Application object. Available as "application.
" in scripting.
Returned Types
APPLICATION_TYPES,CLIENTDESIGN,DRAGNDROP,ELEMENT_TYPES,CSSPosition,Renderable,JSDimension,JSPoint,JSDNDEvent,JSEvent,JSRenderEvent,JSUpload,JSWindow,JSLogger,JSLogBuilder,LOGGINGLEVEL,UICONSTANTS,UUID,WEBCONSTANTS,NGCONSTANTS,
Methods Summarized
Type | Name | Summary |
---|---|---|
void | 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. | |
Close all visible windows (except main application window). | ||
void | Closes the currently open solution and optionally opens another solution, calling a specified global method with the specified arguments. | |
void | Closes the currently open solution and optionally opens another solution, calling a specified global method with the specified arguments. | |
void | Closes the currently open solution and optionally opens another solution, calling a specified global method with the specified arguments. | |
void | Closes the currently open solution and optionally opens another solution, calling a specified global method with the specified arguments. | |
void | Closes the currently open solution and optionally opens another solution, calling a specified global method with the specified arguments. | |
Create a new form instance. | ||
Creates a new window that can be used for displaying forms. | ||
Creates a new window that can be used for displaying forms. | ||
void | Runs at method at the given delay in milliseconds. | |
void | Runs at method at the given delay in milliseconds with the arguments given to the method. | |
Execute a program and returns output. | ||
Execute a program and returns output. | ||
Execute a program and returns output. | ||
Execute a program and returns output. | ||
void | Execute a program in the background. | |
void | Execute a program in the background. | |
void | Execute a program in the background. | |
void | Execute a program in the background. | |
void | Stop and exit application. | |
Get the active user count on the server (can be limited to current solution). | ||
This gets the currently focused active window; this can be the main application window or a modal dialog. | ||
Get the application type. | ||
Gets the count for all clients displaying the same additional information in the Clients page of Servoy Server Administration Console. | ||
Sets a UI property. | ||
Gets a string from the clipboard, null if not a string or empty. | ||
Get the name of the localhost. | ||
Get the clients' IP address. | ||
Get the names of the used client licenses (as strings in array). | ||
Get a JSLogger instance which offers an API for logging with arguments. | ||
Get a JSLogger instance which offers an API for logging with arguments. | ||
Returns the name of the operating system of the client. | ||
Get the screen height in pixels. | ||
Get the screen width in pixels. | ||
Returns a date object initialized on server with current date and time. | ||
Gets the HTTP server url. | ||
Get the uuid from this server instance (the same value that is shown on the admin page) | ||
Returns the name of the current solution. | ||
Get the solution release number. | ||
Get the parameters which are provided by startup. | ||
Returns a date object initialized in client with current date and time. | ||
Get a new UUID object (also known as GUID) or convert the parameter (that can be string or byte array) to an UUID object. | ||
Get a new UUID object (also known as GUID) or convert the parameter (that can be string or byte array) to an UUID object. | ||
Get a new UUID object (also known as GUID) or convert the parameter (that can be string or byte array) to an UUID object. | ||
Get a persistent user property. | ||
Get all persistent user property names. | ||
Retrieve a valuelist as array, to get real-values for display-values. | ||
Retrieve a valuelist display-value for a real-value. | ||
Get all values from a custom or database type value list as dataset (with columns displayValue,realValue). | ||
Get all the valuelist names as array. | ||
Returns the application version. | ||
Get the full version information of this solution and all its modules. | ||
Get the main application window. | ||
Get a window by window name. | ||
Returns true if the solution is running in the developer. | ||
void | Output something on the out stream. | |
void | Output something on the out stream. | |
void | Overrides one style with another. | |
Sets a UI property. | ||
Refresh a global method valuelist by forcing it to call the global method. | ||
Refresh a global method valuelist by forcing it to call the global method. | ||
void | Removes all names given to the client via the admin page. | |
void | Removes all user properties. | |
Removes a string of client information which is stored on the server and previously was added using the application. | ||
void | Removes a user property. | |
void | Sets a string object in the clipboard. | |
void | Sets a user property for this client: In NGClient this is stored in the locale storage of the browser, so it will be persisted over restarts as long as the user didn't clear the data. | |
void | Fill a custom type valuelist with values from array(s) or dataset. | |
void | Fill a custom type valuelist with values from array(s) or dataset. | |
void | Fill a custom type valuelist with values from array(s) or dataset. | |
void | Fill a custom type valuelist with values from array(s) or dataset. | |
void | Fill a custom type valuelist with values from array(s) or dataset. | |
void | Fill a custom type valuelist with values from array(s) or dataset. | |
void | Show the form specified by the parameter, that can be a name (is case sensitive!) or a form object. | |
Shows an URL in a browser. | ||
Shows an URL in a browser. | ||
Shows an URL in a browser. | ||
Shows an URL in a browser. | ||
Shows an URL in a browser. | ||
void | Sleep for specified time (in milliseconds). | |
void | Updates the UI (painting). | |
void | Updates the UI (painting). |
Methods Detailed
addClientInfo(info)
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.
Parameters
String info A line of text to be added as additional client information on behalf of the running Servoy client.
Returns: void
Sample
closeAllWindows()
Close all visible windows (except main application window). Returns true if operation was successful.
Returns: Boolean Boolean true if all windows were closed and false otherwise.
Sample
closeSolution()
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).
Returns: void
Sample
closeSolution(solutionToLoad)
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).
Parameters
String solutionToLoad Name of the solution to load
Returns: void
Sample
closeSolution(solutionToLoad, methodArgument)
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).
Parameters
String solutionToLoad Name of the solution to load
Object methodArgument Argument passed to the solution onOpen
Returns: void
Sample
closeSolution(solutionToLoad, methodName)
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).
Parameters
String solutionToLoad Name of the solution to load
String methodName Name of the global method to call
Returns: void
Sample
closeSolution(solutionToLoad, methodName, methodArgument)
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).
Parameters
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
Returns: void
Sample
createNewFormInstance(designFormName, newInstanceScriptName)
Create a new form instance.
Parameters
String designFormName Name of the design form
String newInstanceScriptName Name of the new form instance
Returns: Boolean Boolean (true) if the instance was created succesfully, (false) otherwise
Sample
createWindow(windowName, type)
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.
Parameters
String windowName the name of the window. Should not be null.
Number type the type of the window. Can be one of JSWindow.DIALOG, JSWindow.MODAL_DIALOG, JSWindow.WINDOW. (WINDOW does not work for NGClient)
Returns: JSWindow the newly created window.
Sample
createWindow(windowName, type, parentWindow)
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.
Parameters
String windowName the name of the window. Should not be null.
Number type the type of the window. Can be one of JSWindow.DIALOG, JSWindow.MODAL_DIALOG, JSWindow.WINDOW (WINDOW doesn't work in NGClient).
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.
Returns: JSWindow the newly created window.
Sample
executeLater(function, delay)
Runs at method at the given delay in milliseconds.
This is like a simple scheduler to quickly run something after a bit of delay
Parameters
Function function The function to call
Number delay The millis that has to elapse before the function is called.
Returns: void
executeLater(function, delay, arguments)
Runs at method at the given delay in milliseconds with the arguments given to the method.
This is like a simple scheduler to quickly run something after a bit of delay
Parameters
Function function The function to call
Number delay The millis that has to elapse before the function is called.
Array arguments The arguments that are given to the function when called.
Returns: void
executeProgram(program)
Execute a program and returns output. Specify the cmd as you would do in a console.
Parameters
String program (fullpath) of the program to execute
Returns: String The output generated by the program execution.
Sample
executeProgram(program, params)
Execute a program and returns output. Specify the cmd as you would do in a console.
Parameters
String program (fullpath) of the program to execute
Array params an array of strings as program arguments
Returns: String The output generated by the program execution.
Sample