cpr.controls.UIControl

Abstract class for UI controls
Hierarchy

Index

Events
Event Description
animationend Event that occurs after the animation ends.
animationend Event that occurs after the animation ends.
animationstart Event that occurs at the start of the animation.
animationstart Event that occurs at the start of the animation.
dispose The event that is called when the control is dispose.
measure-size Event that fires when the size of the control is calculated.
measure-size Event raised when calculating control size
transitionend Event that occurs after the transition ends.
transitionend Event that fires after CSS property transition ends.
transitionstart Event that occurs at the start of the transition.
transitionstart Event that fires when CSS property transition starts.
Properties
Name Type Description
accessbility Accessbility Gets the accessibility-related ARIA properties or gets the context in which they can be specified.
disposed Boolean Returns whether the control should be removed.
editable Boolean Returns whether the value can be changed by user action.
enabled Boolean Returns whether the control is activated.
fieldLabel String Returns the logical field name of the control.
focusable Boolean Returns whether the control is focusable.
focused Boolean Returns whether the control has focus.
id String Returns the ID of the control.
name String Returns the name of the control.
readOnly Boolean Returns whether read-only mode, which cannot be modified, is applied.
style UIControlStyler Returns the style settings of the control.
tooltip String Get control tooltips.
type ControlType Returns the signature string of the Control's unique Type that can distinguish the Control.
uuid String Returns the unique ID of the control.
visible Boolean Get visibility or not.
Methods
Name Return Type Description
addEventListener Add listeners by EventType to the control.
addEventListenerOnce (e: cpr.events.CEvent)=>Void Add a listener to the control that will run only once per EventType.
bind IBindFactory Bind that property.
blur Removes focus from the control.
confirmEvent Boolean Determines whether to run the Control's Default Event Handler depending on the state of the Control.
dispatchEvent Boolean Forwards specific events.
dispose Removes the objects contained in the control.
findParent UIControl Find the parent control.
focus Assigns focus to the control.
focusNext Moves focus to the next control.
focusPrevious Moves focus to the previous control.
getActualRect Rectangle Gets the bounds value of the control relative to the browser's view port.
getAppInstance AppInstance Returns the App to which the control belongs.
getBindContext BindContext Returns the bind context.
getBindInfo BindInfo Returns the bind property information for the control.
getHtmlAttrNames String[] Returns all custom DOM DATA attribute names.
getNextControl UIControl Returns the control to be moved by Tab Key or by the autoskip property.
getOffsetRect Rectangle The area being displayed is obtained based on the parent container to which it belongs.
getParent Container Gets the parent control.
getPrevControl UIControl Shift + Tab Returns the focus to be moved through the key.
getUserAttrNames String[] Returns all custom attribute names.
getVisualParentControl UIControl Gets the closest parent UI control.
htmlAttr Specifies custom DOM properties.
isAvailableBinding Boolean Returns whether the queried property is bindable and the binding has been configured to obtain a valid value.
isBindable Boolean Make sure it is a bindable property.
isFloated Boolean Returns whether the control is floating through an app instance or a specific container.
isShowing Boolean Returns the status that the screen is showing.
redraw Redraw the control.
removeAllEventListeners Removes all event listeners for the control.
removeAllHtmlAttr Delete all custom DOM DATA attributes.
removeAllUserAttr Delete all custom attributes.
removeEventListener Remove Listener for each EventType in the control.
removeEventListeners Remove all EventType listeners from the control.
removeHtmlAttr Removes the user-defined DOM DATA attribute for a specific attribute name.
removeUserAttr Removes user-defined attributes for a specific attribute name.
setBindContext Sets the bind context.
setNextControl Sets the control to be moved by Tab Key or by the autoskip property.
setPrevControl Shift + Tab Set the focus to be moved through the key.
unbind Unbind that property.
userAttr Specifies custom properties.
userData Specifies custom data.
userattr Object Returns a user-defined property.

Events

animationend
CUIEvent Event that occurs after the animation ends.
animationend
CAnimationEvent Event that occurs after the animation ends.
animationstart
CUIEvent Event that occurs at the start of the animation.
animationstart
CAnimationEvent Event that occurs at the start of the animation.
dispose
CEvent The event that is called when the control is dispose.
measure-size
CMeasureSizeEvent Event that fires when the size of the control is calculated. Occurs when the value set in the autoSize property in vertical or flow layout changes.
width: {number} width of the control
height: height of {number} control
measure-size
CMeasureSizeEvent Event raised when calculating control size
transitionend
CUIEvent Event that occurs after the transition ends.
transitionend
CTransitionEvent Event that fires after CSS property transition ends.
transitionstart
CUIEvent Event that occurs at the start of the transition.
transitionstart
CTransitionEvent Event that fires when CSS property transition starts.

Properties

accessbility
type Accessbility
readonly
Gets the accessibility-related ARIA properties or gets the context in which they can be specified.
disposed
declaring type Control
type Boolean
readonly
Returns whether the control should be removed.
editable
type Boolean
readonly
Returns whether the value can be changed by user action.
UIControl (Output, etc.) that does not allow input returns false.
In the case of an inputtable UIControl, returns true if the binding context in which the value is bound is valid.
Otherwise, it returns false even if it is an inputtable UIControl.

Accordion/Button/Group/Dialog/EmbeddedApp/EmbeddedPage/Grid/HTMLObject/Image/MDIFolder/Menu/
NavigationBar/Notifier/Output/Progress/TabFolder/Shell/FileUpload
In the case of the above control, editable is always false.
enabled
type Boolean
get
Returns whether the control is activated. Controls that do not support changing activation always return true.
set
Sets whether to activate the control.
fieldLabel
type String
get
Returns the logical field name of the control.
set
Sets the logical field name of the control.
focusable
type Boolean
readonly
Returns whether the control is focusable.
focused
type Boolean
readonly
Returns whether the control has focus.
id
declaring type Control
type String
readonly
Returns the ID of the control.
name
type String
get
Returns the name of the control.
set
Sets the name of the control.
readOnly
type Boolean
get
Returns whether read-only mode, which cannot be modified, is applied. Controls that do not support read-only mode always return false.
set
Sets whether to enable read-only mode, which can not be modified.
style
type UIControlStyler
readonly
Returns the style settings of the control.
In case of style changes, only the corresponding control is updated.
Propagation from style changes does not occur.
tooltip
type String
get
Get control tooltips.
Controls that do not support tooltips always return null.
set
Specifies the control tooltip.
Operates when mouse over.
type
declaring type Control
type ControlType
readonly
Returns the signature string of the Control's unique Type that can distinguish the Control. Please refer to ControlType for available constant values. For UDC controls, each unique type name is returned. Example: udc.MyUDC
uuid
declaring type Control
type String
readonly
Returns the unique ID of the control.
visible
type Boolean
get
Get visibility or not.
set
Specifies whether it is visible or not. Controls that do not support changing visibility are not affected.

Methods

addEventListener(type, listener)
Add listeners by EventType to the control.
Add a listener to the control to handle when a specific event occurs.
var button = new cpr.controls.Button("btn01");
button.addEventListener("click", function(e) {
// event code...
});
Parameters
name type description
type String
listener (e: cpr.events.CEvent)=>Void
addEventListenerOnce(type, listener)
Add a listener to the control that will run only once per EventType.
Add a listener to the control to handle when a specific event occurs. The added listener is automatically deleted after running once. Since the object of the added listener is changed, when the listener is deleted It is an object returned after calling addEventListenerOnce and can be deleted.
var button = new cpr.controls.Button("btn01");
button.addEventListenerOnce("click", function(e) {
// event code...
});
Parameters
name type description
type String
listener (e: cpr.events.CEvent)=>Void
return (e: cpr.events.CEvent)=>Void The modified Listener object.
bind(name)
Bind that property.
Parameters
name type description
name String
return IBindFactory Factory showing bind type.
blur()
Removes focus from the control.
confirmEvent(e)
Determines whether to run the Control's Default Event Handler depending on the state of the Control.
Parameters
name type description
e CEvent event
return Boolean Whether the control's event handler is running.
dispatchEvent(e)
Forwards specific events.
Parameters
name type description
e CEvent
return Boolean Whether to continue processing the default action after propagating the event.
dispose()
Removes the objects contained in the control.
findParent(predicate, includeSelf)
Find the parent control.
If includeSelf is true, the parent including the self is found.
Parameters
name type description
predicate (c: cpr.controls.UIControl)=>Boolean
includeSelfoptional Boolean defaultfalse Whether you include yourself.
return UIControl Parental control.
focus(forward)
Assigns focus to the control.
Parameters
name type description
forwardoptional Boolean defaulttrue
focusNext()
Moves focus to the next control. If there are multiple structural elements that have focus inside a control, focus may transition to the next element.
focusPrevious()
Moves focus to the previous control. If there are multiple structural elements that have focus inside a control, focus may transfer to the previous element.
getActualRect()
Gets the bounds value of the control relative to the browser's view port. If the control is not drawn on the screen, an object with all values ​​of 0 is returned.
return Rectangle About the position and size of controls in the HTML DOM
getActualRect(includeWrap)
Gets the bounds value of the control relative to the browser's view port. If the control is not drawn on the screen, an object with all values ​​of 0 is returned.
Parameters
name type description
includeWrap Boolean If this value is true, the layout of the parent group gets the area of ​​the node surrounding this control. If false, only get the area of ​​the control node.
return Rectangle About the position and size of controls in the HTML DOM
getActualRect(options)
Gets the bounds value of the control relative to the browser's view port. If the control is not drawn on the screen, an object with all values ​​0 is returned.
Parameters
name type description
options { includeWrap?: Boolean, scaled?: Boolean }
return Rectangle
getAppInstance()
Returns the App to which the control belongs.
return AppInstance App that belongs
getBindContext()
Returns the bind context.
return BindContext bind context
getBindInfo(name)
Returns the bind property information for the control.
Parameters
name type description
name String
return BindInfo BindInfo Properties
getHtmlAttrNames()
Returns all custom DOM DATA attribute names.
return String[] An array of all custom DOM DATA attribute names.
getNextControl()
Returns the control to be moved by Tab Key or by the autoskip property.
return UIControl control.
getOffsetRect(includeWrap)
The area being displayed is obtained based on the parent container to which it belongs.
Parameters
name type description
includeWrapoptional Boolean defaultfalse If this value is true, the layout of the parent group gets the area of ​​the node surrounding this control. If false, only get the area of ​​the control node.
return Rectangle
getParent()
Gets the parent control.
return Container Parental control.
getPrevControl()
Shift + Tab Returns the focus to be moved through the key.
return UIControl control.
getUserAttrNames()
declaring typeControl
Returns all custom attribute names.
return String[] An array of all custom attribute names.
getVisualParentControl()
Gets the closest parent UI control. Unlike getParent(), it finds nearby parent controls, including external apps.
return UIControl
htmlAttr(key, value)
Specifies custom DOM properties.
Parameters
name type description
key String The attribute name to assign
value String The attribute value to specify.
htmlAttr(key)
Returns a custom DOM property.
Parameters
name type description
key String The attribute name to get.
return String Custom properties.
htmlAttr(values)
Specify multiple custom DOM properties at once.
Parameters
name type description
values {[key:string]: String} A JSON object containing custom attribute keys/values.
htmlAttr()
Get all custom DOM properties in the form of a map.
return {[key:string]: String}
isAvailableBinding(name)
Returns whether the queried property is bindable and the binding has been configured to obtain a valid value. Even if no binding is configured and a simple value is specified, it is treated as configured so that a valid value is obtained. For example, binding to a row index that does not exist in the DataSet is an invalid binding.
Parameters
name type description
name String
return Boolean
isBindable(name)
Make sure it is a bindable property.
Parameters
name type description
name String
return Boolean Confirmation.
isFloated()
Returns whether the control is floating through an app instance or a specific container.
return Boolean
isShowing()
Returns the status that the screen is showing. Returns false if the visible state of all parents including itself is false.
return Boolean
redraw()
Redraw the control.
removeAllEventListeners()
declaring typeControl
Removes all event listeners for the control.
removeAllHtmlAttr()
Delete all custom DOM DATA attributes.
removeAllUserAttr()
declaring typeControl
Delete all custom attributes.
removeEventListener(type, listener)
declaring typeControl
Remove Listener for each EventType in the control.
control.removeEventListener ('click', listener);  
Parameters
name type description
type String Event type.
listener (e: cpr.events.CEvent)=>Void Event listeners.
removeEventListeners(type)
declaring typeControl
Remove all EventType listeners from the control.
control.removeEventListeners ('click');  
Parameters
name type description
type String Event type.
removeHtmlAttr(key)
Removes the user-defined DOM DATA attribute for a specific attribute name.
Parameters
name type description
key String The custom DOM DATA attribute name to remove.
removeUserAttr(key)
declaring typeControl
Removes user-defined attributes for a specific attribute name.
Parameters
name type description
key String The custom attribute name to remove.
setBindContext(context)
Sets the bind context.
container.setBindContext({dataControl:grid.dataSet,rowIndex:rowIndex})
Parameters
name type description
context BindContext bind context
setNextControl(nextControl)
Sets the control to be moved by Tab Key or by the autoskip property.
Parameters
name type description
nextControl UIControl control.
setPrevControl(prevControl)
Shift + Tab Set the focus to be moved through the key.
Parameters
name type description
prevControl UIControl control.
unbind(name)
Unbind that property.
Parameters
name type description
name String
userAttr(key, value)
declaring typeControl
Specifies custom properties.
Parameters
name type description
key String The attribute name to assign
value String The attribute value to specify.
userAttr(key)
declaring typeControl
Returns a user-defined property.
Parameters
name type description
key String The attribute name to get.
return String Custom properties.
userAttr(values)
declaring typeControl
Specify multiple custom properties at once.
Parameters
name type description
values {[key:string]: String} A JSON object containing custom attribute keys/values.
userAttr()
declaring typeControl
Get all custom properties in the form of a map.
return {[key:string]: String}
userData(key, value)
declaring typeControl
Specifies custom data. Unlike user-defined attributes, you can use arbitrary types in addition to strings. When the control is dispose, all custom data is removed.
Parameters
name type description
key String The key of the data to be specified.
value Object Data to specify.
userData(key)
declaring typeControl
get custom data
Parameters
name type description
key String The key of the data to get.
return Object
userData(override)
declaring typeControl
Specifies multiple user-defined data.
Parameters
name type description
override {[key:string]: Object} A JSON object containing user-defined data.
userData()
declaring typeControl
Get all your custom data.
return {[key:string]: Object}
userattr()
declaring typeControl
deprecatedPlease use userAttr.
Returns a user-defined property.
return Object Custom properties.