Product introduction Product pricing Quick start Detailed guidance
Components
Chart
Line chart Bar chart
Basic bar chart Horizontal bar chart Horizontal capsule diagram Stacked bar chart
Pie chart
Basic pie chart Pie chart for indicator comparison Percentage pie chart Nightingale graph Pie chart with figure Carousel pie chart Gap pie chart
Radar chart
Radar chart Radar chart - polygonal Radar chart - circular
Scatter chart
Scatter chart Bubble chart
Dial
Basic dial Time dial Speed dial
Others
Text Map Multi-media
Video player RTMP player Single image iframe loader
Control Source material
Data usage
Example demonstration Service agreement Service level agreement

# Variable call-back

What is the callback variable?

In OneNET View 2.0, callback variable means the parameter transmitted by a component to another component or data source in response to user actions or upon automatic triggering of updating.

When a callback variable is used in a data source, the value of this variable can be used as a dynamic variable in data query.

For example, paging is needed in some scenes. At this time, we can transmit the pageparameter in the paging component. After API interface receives this page variable, dynamic query of the corresponding page data can be performed.

pic

Configuration of callback variable

Configuration under component interaction tab

Once a component is selected, the set area will appear in the right of the editor. The callback variable can be set in the interaction tab in this area.

Each callback variable is provided with an independent enable switch.

You can modify the variable name in “bound to variable” based on the application.

pic

As shown on the figure, we bind the value of the text component to variablecity. When the text component is clicked (for interactive events without special instructions, the default is the component click event), a variable namedcity whose value is the value of the text component (“Chongqing” on the figure) will be set in the item.

The query parameters already occupied by the system cannot be set as callback variables, which at this time include: id,shareCode,debug

We can set the callback variable and the respective default value by setting the queryparameter in the url. For example.

http://open.iot.10086.cn/view/main/#/view2d?id=5e68872cb390c9c2e9af7ba9&hello=lingc

In case of access via this url, when the page is loaded, the value of the callback variable hello has been set to lingc.

The \& symbol is used for connection between callback variables, for example

http://open.iot.10086.cn/view/main/#/view2d?id=5e68872cb390c9c2e9af7ba9&hello=lingc&city=chongqing

The default values of callback hello and city are set at the same time.

Viewing of an item’s callback variable

We provide the “view variable” buttons on edit page and browse page (except the share page). After clicking the variable button, the current variable and its value of the item will appear. pic

Use of callback variable

Used in data source

Used in data source: the corresponding callback variable can be used as the variable name (e.g. city).

Used in API data source

In API data source, Path, Query, Header and Body all support setting the key value with the callback variable. For example: pic herein

http://apis.juhe.cn/simpleWeather/query?city=:city&key=73a0b2fe78c2e9d07df67ca848213ad7

In actual request, :city will be substituted with the specific value of the callback variable.

Used in OneNET data source

With the support of callback variables, together with OneNET data source, we can switch and observe the data of multiple OneNET devices on the same large screen.

After setting the device variable, the value (if any) of the variable will be directly used as the device ID. After setting the data stream variable, the value (if any) of variable will be directly used as the data stream ID.

For example: pic For the OneNET data source on the above figure, the device and data stream are bound with callback variables. The value (if any) of the callback variable is preferred; otherwise, the device and data stream selected in the drop-down box will be adopted.

Used in the filter

Used in the filter: the callback variable can be accessed through the parameter “variables” in the filter.

Viewing of callback variable


pic

Use of callback variable


pic

个搜索结果,搜索内容 “

    0 个搜索结果,搜索内容 “