Window Plugin
(part of package 'Servoy Default Services')
You can access it in code via: plugins.window
Properties
API
cancelFormPopup()
Close/cancels the current form popup panel without assigning a value to the configured data provider.
Example:
closeFormPopup(retval)
Close the current form popup panel and assign the value to the configured data provider.
Example:
Parameters:
{Object} retval Return value for data provider
createFormPopup(form)
Create a form popup that can be filled with data and shown.
Example:
Parameters:
{Form} form The form to show
Returns: CustomType<window.FormPopup> A FormPopup instance that can be populated with data and displayed.
createPopupMenu(menu,callback)
Creates a new popup menu, either empty, or initialized from an existing JSMenu.
Example:
Parameters:
{JSMenu} [menu] The JSMenu whose structure will be used to initialize the popup menu.
{Function} [callback] The menu item click handler that will be set on all popup menu items. The callback signature is: function(itemIndex:number, parentIndex: number, isSelected: boolean, parentMenu: String, menu: String)
Returns: CustomType<window.Popup> A new popup menu instance, optionally initialized with the provided JSMenu structure and callback function.
createShortcut(shortcut,callback,contextFilter,arguments,consumeEvent)
Create a shortcut.
Example:
Parameters:
{String} shortcut The keyboard shortcut combination (e.g., 'control shift I', 'F4', 'NUMPAD8') to trigger the action.
{Function} callback Scopes.scopename.methodname or formname.methodname String to target the method to execute
{String} [contextFilter] Form or element name ( ng only - specified by formName.elementName); only triggers the shortcut when on this form/element
{Array<object>} [arguments] An optional array of arguments to pass to the method when the shortcut is executed.
{Boolean} [consumeEvent] If true then the shotcut will consume the event and the default browser behavior will not be executed (default false)
Returns: Boolean True if the shortcut was successfully created; otherwise, false.
getFormPopup(form)
It will return a FormPopup with the form passed as an argument or null.
Example:
Parameters:
{Form} form The form instance to be used in the popup.
Returns: CustomType<window.FormPopup> A FormPopup instance containing the specified form, or null if the popup could not be created.
removeShortcut(shortcut,contextFilter)
@clonedesc js_removeShortcut(String) Example:
Parameters:
Returns: Boolean True if the shortcut was successfully removed; otherwise, false.
showFormPopup(component,form,scope,dataProviderID,width,height,x,y,showBackdrop,doNotCloseOnClickOutside,onClose)
Show a form as popup panel, where the closeFormPopup can pass return a value to a dataprovider in the specified scope. Can show relative to a component or at specified coordinates. Show on specified location and backdrop is only supported in NGClient.
Example:
Parameters:
{Runtimecomponent} component Element to show related to or null to center in screen
{Form} form The form to show
{Object} scope The scope to put retval into
{String} dataProviderID The dataprovider of scope to fill
{Number} [width] Popup width
{Number} [height] Popup height
{Number} [x] Popup x location
{Number} [y] Popup y location
{Boolean} [showBackdrop] Whatever to show a dimmed backdrop under the popup
{Boolean} [doNotCloseOnClickOutside] Whether to close on not close the popup on clicking outside
{Function} [onClose] A callback function that is being triggered once the formpopup window is being closed
Types
CheckBox
scripting type: CustomType<window.CheckBox> extends: MenuItem
FormPopup
scripting type: CustomType<window.FormPopup>
cancel()
Close/Cancel the current form and his children if applicable.
Example:
component()
Returns the component.
Example:
Returns: runtimecomponent The FormPopup itself if it's used as a setter or the component if no argument is given
component(component)
Set component form popup will be shown relative to. If null, will use coordinates or show at screen center.
Example:
Parameters:
runtimecomponent component The form to show
Returns: FormPopup The FormPopup itself if it's used as a setter or the component if no argument is given
createFormPopup(form)
Create a form popup that can be filled with data and shown.
Example:
Parameters:
form form The form to show
Returns: FormPopup ** FormPopup
dataprovider()
Returns the datprovider value
Example:
Returns: string The FormPopup itself if it's used as a setter or the dataprovider value if no argument is given
dataprovider(dataprovider)
Set form popup dataprovider that will be set. If this is set, also scope needs to be specified.
Example:
Parameters:
string dataprovider Form popup dataprovider
Returns: FormPopup The FormPopup itself if it's used as a setter or the dataprovider value if no argument is given
height()
Returns the height.
Example:
Returns: int The FormPopu