cpr.core.AppInstance
App instance class. Have information about your app
Index
Event |
Description |
before-context-value-change |
Use a bind context in a control that has a bind context
An event that occurs before the value changes. |
blur |
An event that occurs after the control loses focus. |
click |
An event that occurs when the user clicks the control. |
context-value-change |
Use a bind context in a control that has a bind context
An event that occurs after the value changes. |
contextmenu |
When the right mouse button is clicked or the context menu key is pressed,
Event called. |
dblclick |
An event that occurs when the user double-clicks the control. |
dragenter |
When the mouse pointer enters the elements included in the control while dragging
Events that occur. |
dragleave |
During the drag, the mouse pointer may have exited the elements contained in the control. |
dragover |
While dragging the source control with the mouse, the mouse pointer
An event that occurs when moving within a region. |
drop |
Drag the source control to the target control while dragging the source control with the mouse. |
focus |
The event that occurs after the control gains focus. |
host-change |
This event occurs when the app is included in or leaves the parent app. |
init |
An event that occurs when the app is initially configured. |
keydown |
Event raised when the user presses a key. |
keyup |
Event that occurs when the user releases the key. |
load |
An event that occurs immediately after the initial render of the app. |
mousedown |
When the user presses the mouse button with the pointer over the control
Occurs when an event occurs. |
mouseenter |
An event that occurs when the mouse pointer enters the control. |
mouseleave |
If the user moves the mouse pointer beyond the control and its children
Events that occur when moving. |
mousemove |
This event is raised when the user moves the pointer over the control. |
mouseup |
The user releases the mouse button while over the control. |
property-change |
Event that fires when an app's properties change. |
screen-change |
Event called when the screen size changes. |
touchcancel |
What happens when one or more touch points are interrupted in a particular implementation
event. |
touchend |
What happens when one or more touch points are removed from the touch surface
event. |
touchmove |
What happens when one or more touch points move along the touch surface
event. |
touchstart |
What happens when one or more touch points are placed on a touch surface
event. |
unload |
An event that occurs after the app has been unloaded. |
Events
CValueChangeEvent Use a bind context in a control that has a bind context
An event that occurs before the value changes.
CFocusEvent An event that occurs after the control loses focus.
CMouseEvent An event that occurs when the user clicks the control.
CValueChangeEvent Use a bind context in a control that has a bind context
An event that occurs after the value changes.
CMouseEvent When the right mouse button is clicked or the context menu key is pressed,
Event called.
CMouseEvent An event that occurs when the user double-clicks the control.
CMouseEvent When the mouse pointer enters the elements included in the control while dragging
Events that occur.
CMouseEvent During the drag, the mouse pointer may have exited the elements contained in the control.
The event that occurs when.
CMouseEvent While dragging the source control with the mouse, the mouse pointer
An event that occurs when moving within a region.
CMouseEvent Drag the source control to the target control while dragging the source control with the mouse.
Event that fires when dropping.
CFocusEvent The event that occurs after the control gains focus.
CEvent This event occurs when the app is included in or leaves the parent app.
CEvent An event that occurs when the app is initially configured.
CKeyboardEvent Event raised when the user presses a key. Keycode related constants can be referenced at
KeyCode.
CKeyboardEvent Event that occurs when the user releases the key. Keycode related constants can be referenced at
KeyCode.
CEvent An event that occurs immediately after the initial render of the app.
CMouseEvent When the user presses the mouse button with the pointer over the control
Occurs when an event occurs.
CMouseEvent An event that occurs when the mouse pointer enters the control.
CMouseEvent If the user moves the mouse pointer beyond the control and its children
Events that occur when moving.
CMouseEvent This event is raised when the user moves the pointer over the control.
CMouseEvent The user releases the mouse button while over the control.
When an event occurs.
CTouchEvent What happens when one or more touch points are interrupted in a particular implementation
event.
CTouchEvent What happens when one or more touch points are removed from the touch surface
event.
CTouchEvent What happens when one or more touch points move along the touch surface
event.
CTouchEvent What happens when one or more touch points are placed on a touch surface
event.
CEvent An event that occurs after the app has been unloaded.
Properties
type
|
String[] |
readonly
|
Returns the names of all supported screens.
|
type
|
String[] |
readonly
|
Get each media query for all supported screens.
|
type
|
Screen[] |
readonly
|
Get all screen objects supported by this app instance.
The return value is a read-only copy object.
|
type
|
App |
readonly
|
App object
|
type
|
Boolean |
readonly
|
Whether the app was destroyed.
|
type
|
Boolean |
get
|
Whether to return from the last focus to the beginning.
|
set
|
Sets whether to return from the last focus to the beginning.
|
type
|
String |
readonly
|
Your app's id
|
type
|
Boolean |
readonly
|
Returns whether the app has ever been displayed on the screen.
If it has been displayed on the screen even once for the first time, true ,
Returns false if it has never been displayed.
|
type
|
String |
readonly
|
Gets a media query for the currently active screen.
|
type
|
String |
readonly
|
Gets the name of the currently active screen.
|
type
|
Screen |
readonly
|
Gets the currently active Screen object.
The return value is a read-only copy object.
|
type
|
String |
readonly
|
Your app's unique ID
|
Methods
Add a property of the bindable app.
name |
type |
description |
name
|
String |
Attribute name |
initialValue
|
Object |
Initial value |
Add a Listener for each EventType to the control.
Add a listener that handles when a specific event occurs in the control.
var button = new cpr.controls.Button("btn01");
button.addEventListener("click", function(e) {
//event code...
});
name |
type |
description |
type
|
String |
Event type. |
listener
|
(e: cpr.events.CEvent)=>Void |
Event listeners. |
Add a Listener to the control that will run only once per EventType.
Add a listener that handles when a specific event occurs in the control.
The added listener is automatically deleted after it is run once.
Since the object of the added listener changes, when deleting the listener
The object returned after calling addEventListenerOnce can be deleted.
var button = new cpr.controls.Button("btn01");
button.addEventListenerOnce("click", function(e) {
//event code...
});
name |
type |
description |
type
|
String |
Event type. |
listener
|
(e: cpr.events.CEvent)=>Void |
Event listeners. |
return
|
(e: cpr.events.CEvent)=>Void |
The modified Listener object. |
Call the app method. Unlike callAppMethod() passing arguments in a spread form, it passes arguments as a single array.
name |
type |
description |
name
|
String |
The name of the app method to be called. |
args
|
Array |
Call argument. |
Bind the properties of the app.
name |
type |
description |
name
|
String |
Attribute name. |
Among the floatControl and Dialog floating in the App, the specific control is displayed as the top level.
Call the app method.
name |
type |
description |
name
|
String |
The name of the app method to be called. |
args
|
Array |
Call argument. |
Close the app.
name |
type |
description |
returnValueoptional
|
Object |
If your app is working within a dialog, you can pass the return value while closing the app. |
Creates and returns a Workflow object that can access the controls in AppInstance.
name |
type |
description |
debugoptional
|
Boolean |
defaultfalse
|
|
Declare app properties.
name |
type |
description |
propName
|
String |
Attribute name. |
defaultValue
|
Object |
Default value. |
Declare bindable app properties.
name |
type |
description |
propName
|
String |
Attribute name. |
defaultValue
|
Object |
Default value. |
Forwards specific events.
name |
type |
description |
e
|
CEvent |
event |
Removes the objects contained in the control.
Use the coordinates in the browser viewport to obtain the controls that exist below those coordinates.
They are returned in order, starting from the frontmost one on the screen.
name |
type |
description |
clientLocation
|
Point |
Viewport coordinates to retrieve. |
Use the coordinates in the browser viewport to obtain the controls that exist below those coordinates.
They are returned in order, starting from the frontmost one on the screen.
name |
type |
description |
x
|
Number |
Viewport X-coordinate (clientX) |
y
|
Number |
Viewport Y coordinate (clientY) |
Floats a control at a specific location in the app.
Regardless of the layout, separate from the UIControl added to the app's container
This method is used when you want to randomly position a control at a specific location within the app.
This can be used, for example, to output a context menu.
name |
type |
description |
control
|
UIControl |
UIControl to populate the App area. |
stylesoptional
|
{[key:string]: String} |
default{}
|
A style or cpr.geometry.Rectangle object that describes the position of the control to be displayed. |
Gives focus to a specific UIControl in the App.
name |
type |
description |
controlOrId
|
UIControl |
The ID of the UIControl to get focus or a UIControl object |
forwardoptional
|
Boolean |
defaulttrue
|
|
Moves focus to the next control.
name |
type |
description |
control
|
UIControl |
The control that currently owns focus. |
Moves the focus to the previous control.
name |
type |
description |
control
|
UIControl |
The control that currently owns focus. |
The app returns the actual drawn size.
If the app is not drawn on the screen, an object with all values of 0 is returned.
name |
type |
description |
optionsoptional
|
{
scaled?: Boolean
} |
|
Get all app properties.
return
|
{[key:string]: Object} |
|
Get all data controls (datasets, views, maps, submissions) registered in the app instance.
Returns the properties of the app.
name |
type |
description |
propertyName
|
String |
The name of the attribute. |
return
|
Object |
Property of the app. |
deprecatedThis function was provided for type inference in the script editor. Please use getAppProperty.
Returns the app properties as a boolean type.
name |
type |
description |
propertyName
|
String |
Attribute Name |
deprecatedThis function was provided for type inference in the script editor. Please use getAppProperty.
Returns the app properties as a number type.
name |
type |
description |
propertyName
|
String |
Attribute Name |
deprecatedThis function was provided for type inference in the script editor. Please use getAppProperty.
Returns the app properties as a string.
name |
type |
description |
propertyName
|
String |
Attribute Name |
Returns the bind attribute information of the app.
name |
type |
description |
name
|
String |
The name of the attribute being bound. |
Returns the bind context.
Returns the container of the app.
You get a UI control with the first focus traversal sequence via the tab key.
You get a UI control with the first focus traversal sequence via the tab key.
Get the floating controls.
Get the floating controls.
Returns the embedded app object.
Returns the appInstance of the embedded app.
Returns the properties of the embedded app control. That property must be a bindable property.
name |
type |
description |
name
|
String |
The name of the attribute. |
Gets the UI control with the last focus traversal sequence via the tab key.
Gets the UI control with the last focus traversal sequence via the tab key.
When the app runs, it gets the minimum size information it needs.
Returns the top-level app instance.
Returns whether the app has a method.
name |
type |
description |
name
|
String |
method name. |
return
|
Boolean |
Include method. |
Returns whether there is a property of bindable app.
name |
type |
description |
name
|
String |
Attribute name. |
Returns whether the app is an embedded app.
return
|
Boolean |
Whether you have an embedded app. |
Returns whether or not it is the root App.
return
|
Boolean |
Whether it is the root app. |
Returns whether this app instance is a UDC app instance.
Find the object by its ID.
name |
type |
description |
id
|
String |
The ID of the object to find. |
Find the object by UUID.
name |
type |
description |
uuid
|
String |
The UUID of the object to find. |
Open the dialog in the app.
To change the app of an existing dialog, use the dialogName property of DialogManager.openDialog.
app.openDialog("dlgs/people", {width:400, height:300});
name |
type |
description |
appId
|
#app |
The ID of the app to open |
prop
|
AppOpenDialogOption |
The Property to define the properties of the Dialog. |
handleroptional
|
(dlg: cpr.controls.Dialog)=>Void |
If you need to handle the Dialog object more specifically, you can add handlers to handle the Dialog (you can add event handlers, change styles, etc.) |
return
|
Promise<Object> |
Promise chain to be connected when the dialog is closed. It is called only when there is a dialog return value. |
Open the dialog in the app.
To change the app of an existing dialog, use the dialogName property of DialogManager.openDialog.
app.openDialog(appToShow, {width:400, height:300});
name |
type |
description |
app
|
App |
App to open |
prop
|
AppOpenDialogOption |
The Property to define the properties of the Dialog. |
handleroptional
|
(dlg: cpr.controls.Dialog)=>Void |
If you need to handle the Dialog object more specifically, you can add handlers to handle the Dialog (you can add event handlers, change styles, etc.) |
return
|
Promise<Object> |
Promise chain to be connected when the dialog is closed. It is called only when there is a dialog return value. |
Registers identifiable objects.
name |
type |
description |
object
|
Identifiable |
The object to register. |
Removes all event listeners for the control.
Remove floatControl and Dialog floating in the App.
name |
type |
description |
shouldDisposeoptional
|
Boolean |
defaultfalse
|
Whether to dispose at the same time as removal. |
Remove Listener by EventType from control.
control.removeEventListener('click', listener);
name |
type |
description |
type
|
String |
Event type. |
listener
|
(e: cpr.events.CEvent)=>Void |
Event listeners. |
Removes certain controls among floatControl and Dialog floating in the App.
name |
type |
description |
control
|
UIControl |
Instance of UIControl to remove. |
shouldDisposeoptional
|
Boolean |
defaultfalse
|
Whether to dispose at the same time as removal. |
Loads and returns the common module created in the project.
If the file name of the common module you want to load is com.module.js, the qualifiedName is lib.com.
var mod_com = app.requireModule("lib.com");
name |
type |
description |
qualifiedName
|
String |
The ID of the Module to load. |
Run the app.
name |
type |
description |
hostoptional
|
EmbeddedApp |
App |
callbackoptional
|
(app: cpr.core.AppInstance)=>Void |
The callback function to execute. |
Specify multiple app properties at once.
name |
type |
description |
properties
|
{[key:string]: Object} |
The attribute JSON object to specify. |
fireEventoptional
|
Boolean |
defaulttrue
|
Whether to propagate property-change events. |
Set your app's properties.
name |
type |
description |
propertyName
|
String |
The name of the attribute. |
value
|
Object |
The value of the attribute |
fireEventoptional
|
Boolean |
defaulttrue
|
Whether to propagate property-change events. |
Set the properties of the embedded app control to which it belongs. That property must be a bindable property.
name |
type |
description |
name
|
String |
Attribute Name |
value
|
Object |
The value of the attribute |
Specifies the minimum size required for the app instance to function.
name |
type |
description |
width
|
Number |
Minimum width. Negative numbers indicate no constraint. |
height
|
Number |
Minimum height. Negative numbers indicate no constraint. |
Specifies the minimum size required for the app instance to function.
name |
type |
description |
size
|
Dimension |
Minimum size |
deprecatedIt was discovered that this API was inadvertently leaked as it was supposed to be called from within the system.
Specifies the currently active media.
name |
type |
description |
targetMedia
|
String |
The currently active media or screen name |
Add a media query that describes the supported screen specifications.
This method can only be called while the app is initializing.
Otherwise it is ignored.
name |
type |
description |
mediaQuery
|
String |
Media query to add. |
mediaNameoptional
|
String |
defaultnull
|
|
Unbind the properties of the app.
name |
type |
description |
name
|
String |
Attribute name. |
Removes the registered object.
name |
type |
description |
object
|
Identifiable |
The object to remove. |
Returns all app properties with default values to their default state.
The values of all app properties declared with declareAppProperty() and declareBindableAppProperty() are reset to their initial values.
name |
type |
description |
fireEventoptional
|
Boolean |
defaulttrue
|
Whether to propagate property-change events. |
Returns the values of certain app properties to their default values.
name |
type |
description |
propertyName
|
String |
App property name to return to default. |
fireEventoptional
|
Boolean |
defaulttrue
|
Whether to propagate property-change events. |