Skip to content

Class: ControlProxy

The ControlProxy is a developer-facing class that provides access to a control. It is passed to rules to provide access to a control for application-specific customizations.

Hierarchy

Implements

Summary

Constructors

Properties

Class Properties

Inherited Properties

Accessors

Class Accessors

Currently none in this class.

Inherited Accessors

Methods

Class Methods

Inherited Methods

Constructors

Constructor

+ new ControlProxy(context: IContext): ControlProxy

Overrides ClientAPI.constructor

Parameters:

Name Type
context IContext

Returns: ControlProxy

Properties

Protected _control

• _control: any

Methods

Protected _getExecuteSource

▸ _getExecuteSource(): ExecuteSource

Overrides ClientAPI._getExecuteSource

Returns: ExecuteSource


applyValidation

▸ applyValidation(): void

Applies the validation view, if it's supported for the given control

Note: We have Validation property to replace validationProperties in FormCell controls. If you are using new Validation property, you can call redraw() on control level to apply validation changes

Implementation of IControlProxy.applyValidation

Returns: void


clearValidation

▸ clearValidation(): void

Hides the validaiton view. Shorter version of: clientAPI.setupValidationProperties('ValidationViewIsHidden', true).applyValidation();

Note: We have Validation property to replace validationProperties in FormCell controls. If you are using new Validation property, you can call setVisible() API in FormCellValidationProxy

Implementation of IControlProxy.clearValidation

Returns: void


clearValidationOnValueChange

▸ clearValidationOnValueChange(): void

Hides the validaiton view while changing value

Note: We have Validation property to replace validationProperties in FormCell controls. If you are using new Validation property, you can call setVisible() API in FormCellValidationProxy

Implementation of IControlProxy.clearValidationOnValueChange

Returns: void


getCaption

▸ getCaption(): string

Implementation of IControlProxy.getCaption

Returns: string

the caption of the contol


getName

▸ getName(): string

Implementation of IControlProxy.getName

Returns: string

the name of the contol


getPageProxy

▸ getPageProxy(): IPageProxy

Implementation of IControlProxy.getPageProxy

Returns: IPageProxy

the Page, which the control belongs to


getParent

▸ getParent(): IClientAPI

Returns: IClientAPI

the parent, which the control belongs to


getType

▸ getType(): string

Implementation of IControlProxy.getType

Returns: string

the type of the contol


getValue

▸ getValue(): any

Implementation of IControlProxy.getValue

Returns: any

the value of the contol


isContainer

▸ isContainer(): boolean

Determine if the control is a container control

Implementation of IControlProxy.isContainer

Returns: boolean

returns true if the control is a container control. Otherwise, returns false. It always returns false for a simple control


redraw

▸ redraw(): Promise<any>

Use this method to redraw the control. In cases where a control does not have redraw semantics the control's container will redraw

Implementation of IControlProxy.redraw

Returns: Promise<any>


setEditable

▸ setEditable(value: boolean): Promise<any>

Set the control's editable status

Implementation of IControlProxy.setEditable

Parameters:

Name Type Description
value boolean editable setting

Returns: Promise<any>

this - allows chaining


setStyle

▸ setStyle(styleClass: string, subView: string): ControlProxy

Apply styles to a control

Implementation of IControlProxy.setStyle

Parameters:

Name Type Description
styleClass string The name of the style class to be applied
subView string The name of the subview to apply the style to. If this is '', the style is applied to the entire control. If the style format is nested controls, we could combine control views with slash '/', such as 'parent/child'.

Returns: ControlProxy


setValidationProperty

▸ setValidationProperty(key: string, value: any): ControlProxy

Sets the validationProperties parameter of the underlying Observable. Currently only the FormCell Observable is supported.

This will not cause the UI to rerender. To redraw the form cell, use the applyValidation API.

Note: We have Validation property to replace validationProperties in FormCell controls. If you are using new Validation property, you can set properties by calling APIs in FormCellValidationProxy

Implementation of IControlProxy.setValidationProperty

Parameters:

Name Type Description
key string the key of the validaiton property Available keys: - SeparatorBackgroundColor (hex color as string e.g.: 'ffffff') - SeparatorIsHidden (boolean) - ValidationMessage (string) - ValidationMessageColor (hex color as string e.g.: 'ffffff') - ValidationViewBackgroundColor (hex color as string e.g.: 'ffffff') - ValidationViewIsHidden (boolean)
value any the value of the validation property

Returns: ControlProxy

the current instance of the ControlProxy class


setValue

▸ setValue(value: any, notify?: boolean = true): ControlProxy

Set the value in the control

Implementation of IControlProxy.setValue

Parameters:

Name Type Description
value any value to be set
notify? boolean = true whether to send the notification

Returns: ControlProxy

this - allows chaining


setVisible

▸ setVisible(value: boolean, redraw?: boolean = true): ControlProxy

Sets the control's visible state with / without redraw

Implementation of IControlProxy.setVisible

Parameters:

Name Type Description
value boolean visible state
redraw? boolean = true true if redraw after set the visible state

Returns: ControlProxy