<< 点击显示目录 >> 主页 mappView帮助助手 > mapp View帮助信息 > Widgets > Data > Database > Concept > Example configuration |
The following explains how to configure and use widget "Database".
Our B&R Tutorial Portal includes tutorials on widget "Database" (GER/ENG). (access data) |
To use widget "Database", MpDatabaseCore configuration must be added and configured. Function block MpDatabaseCore establishes a connection to a database.
For information about how to implement and configure mapp Database, see section "Connecting to a database" of "Getting started". |
Our B&R Tutorial Portal includes tutorials about mapp Database). |
Widget "Database" is added in a piece of content.
The mapp Link of a MpDatabaseCore configuration must be specified on property mpLink.
Database information can be requested via queries. The queries are created in the MpDatabaseCore configuration. Only SELECT queries can be displayed and executed in the widget.
The queried information can be displayed in different ways. For more information about the various display options, see section Displaying the information.
Adding widget "Table"
In this example, the information is displayed in a table using widget "Table".
This means that widget "Table" is added to widget "Database".
Depending on how much information the query returns, a corresponding number of "TableItem" widgets is added. If more columns are configured than necessary, the remaining columns are hidden and not displayed at runtime.
Adding widget "Selector"
To start a query, widget "Selector" must be used. That means that widget "DropDownBox", "Listbox", or "TextPicker" can be used. This example uses widget "TextPicker". This is added inside widget "Database":
For more information about selector widgets, see section Arbeiten mit dem Database-Widget.
Finally, library MpServer must be added. For more information, see here. After the changes are downloaded to the target system, the widget can be displayed.
Web browser
The configuration is now complete. In order for queries to be displayed and started, a connection must be established between mapp Database and a database system.
For an explanation of how to work with widget "Database", see here.