All Products
Search
Document Center

DataV:How to Use Callback IDs to Implement Component Linkage

Last Updated:May 15, 2023

This topic describes how to click a widget in the DataV console and configure the callback ID of the widget to interact with another widget.

What is a callback ID?

A callback ID is a variable used to pass parameters between widgets to achieve interactions between the widgets. For example, the number flip widget in the following figure, when the flip widget is clicked, the current value is passed to other widgets through the income field for display. image..png

Configure a callback ID

  1. Log on to the DataV console.
  2. Click the TicketMaker widget and click the Interactive tab on the right side of the editor canvas.

  3. Select Enable next to Digital Change Response Event.

    image..png
  4. Modify the name of the variable bound to the variable and change the value to income.

    After the configuration is complete, other components can use the income to obtain the corresponding parameter values.

Use a callback ID

  1. Click the Data tab.

  2. Click Configure Data Source and set the data source type to Database.

  3. Enter a select :income as value in the SQL input box.

  4. Click the image..pngicon in the upper-right corner to preview the results. image..png

  5. After you click the number flip box at the top, the value at the bottom is the same as that at the top. This allows you to use the callback ID to obtain data. p636269..png

FAQ

Q: What can I do if I cannot obtain the callback value after I configure the callback ID on the canvas edit page and the data query fails?

A: The canvas editing page fails to trigger an event to obtain the callback value. As a result, the request fails. You can view the callback value by using one of the following methods:

  • Preview the project. View the callback value in the URL, or click the Network tab in the browser console and obtain the value in the response.

  • Edit the project. Add test parameters next to the URL of the visual application to test the data.

    https://datav.aliyun.com/admin/screen/99999? parameter name=parameter value