Actions and events

<< 点击显示目录 >>

主页  mappView帮助助手 > mapp View帮助信息 > Widgets  > Data  > Database  >

Actions and events

The following section describes the possible actions and events for the widget.

Actions

Name

Description

Arguments

Result

SetVisible

Controls the visibility of the widget.

value: Boolean

Visible if the value is true. Otherwise, invisible.

 

SetEnable

Controls the usability of the widget.

value: Boolean

Enabled if the value is true. Otherwise, disabled.

 

SetQuery

The specified query is executed by mapp Database.

For the name of the query, see MpDatabaseCore configuration.

Return value "result" returns true if the query is executed, and "result" returns false if the query is not executed.

query: String

result: Boolean

ReloadQuery

This action reloads the data for the currently selected query. If the query is executed, the action returns "true".

Return value "result" returns true if the query is executed again, and "result" returns false if the query is not executed again.

 

result: Boolean

Focus

Sets the focus to the widget when keyboard operation is enabled.

 

 

Table: Actions

Reading actions

To obtain the result of a reading action, an "operand" must be used. For more information, see here. For how the result can be used in the ResultHandler, see here.

Name

Description

Result

GetQuery

This action delivers the currently selected query of the database widget.

result: String

Table: Reading actions

Events

Name

Description

Arguments

Click

Triggered when clicking on the widget.

origin: String

"origin" contains the ID of the widget that triggers the click event.

horizontalPos: String

horizontalPos contains the horizontal position of event "Click" in pixels (e.g. 10px starting from the viewport).

verticalPos: String

verticalPos contains the vertical position of the click event in pixels (e.g. 10px starting from viewport).

DisabledClick

Triggered when clicking on the disabled widget.

origin: String

"origin" contains the ID of the widget that triggers the click event.

hasPermission: Boolean

"hasPermission" defines whether the current user has the necessary rights to access it.

horizontalPos: String

horizontalPos contains the horizontal position of the DisabledClick event in pixels (e.g. 10px starting from viewport).

verticalPos: String

verticalPos contains the vertical position of the DisabledClick event in pixels (e.g. 10px starting from viewport).

EnableChanged

Triggered when the usability of the widget is changed. This can be changed using various options:

1) Using property enable (binding or via widget action SetEnable)

2) Using property permissionOperate

3) Using usability properties (enable, permissionOperate, OPC UA variable) of the surrounding container widget

4) Using a bound OPC UA variable with write permissions that have been changed.

value: Boolean

"value" defines the usability of the widget. If true is returned, the widget can be used; if false, it cannot be used.

VisibleChanged

Triggers when the visibility of the widget is changed. This can be changed using various options:

1) Using property visible (binding or via widget action SetVisible)

2) Using property permissionView

3) Using the visibility properties (visible, permissionView) of the surrounding container widget

value: Boolean

"value" defines the visibility of the widget. If true is returned, the widget is displayed; if false, it is not displayed.

QueryNames

Triggered if the widget successfully connects with mapp Database and SELECT queries are available.

dataprovider: ItemCollection

Specifies the SELECT queries.

OnError

Triggered if a communication error with the mapp component occurs.

result: Integer

"result" returns the error number of the mapp component.

StartLoading

Triggered when the database widget queries the mapp component for data.

 

EndLoading

Triggered when the database widget no longer receives data from the mapp component.

 

ProgressLoading

Triggered when the database widget receives new data from the mapp component.

 

currentRow: Integer

"currentRow" returns the currently loaded row

maxRows: Integer

"maxRows" returns the total number of rows the database widget has to upload.

FocusIn

Triggered when a widget gets the focus.

 

FocusOut

Triggered when a widget loses focus.

 

Table: Events