Building gadget links
Use the gadget menu to add or remove links to other gadgets. Gadgets on a BIRT dashboard link together automatically when they use the same data source. Gadgets that do not use the same data source are linked by manual configuration. If you need to process the selected values before they are used to filter data in a gadget, add JavaScript to the linked gadget.
The following gadgets filter data when linked to data selection gadgets:
*Data visualization gadgets
*Other data selection gadgets
*Report gadgets
For example, you display a chart of stock prices on a dashboard with a list of stock names and a calendar to select dates. When a user selects a stock name, the chart displays prices for the stock on the chart. When the user selects a date in the calendar, the chart displays the selected stock name on the selected date.
Import gadgets can link together using JavaScript to create new content or retrieve external content from a user selected value. For example, one import gadget can show a world map and publish the name of a user selected country. You can link a second import gadget to the first and generate a report about the user selected country.
In the gadget menu, choose Link to display gadgets on the dashboard that accept links.
Understanding automatic linking
When a gadget is added to a dashboard, it is automatically linked to any other gadgets on the dashboard that use the same data source. If an existing gadget’s data source changes to one matching other gadgets on the dashboard, it also links to those gadgets.
For example, you create a new dashboard and add a bar chart gadget showing customer orders by country. You then add a list gadget displaying territory names from the same data source as the chart. The chart gadget automatically links to the new list gadget. When a user selects a territory in the list gadget, the chart shows countries in the selected territory.
If you add a list of product lines from the same data source as the territory list and the chart, the gadgets link together. When the user selects a territory, the product lines sold in that territory appear in the list. When a product line is selected, territories where that product line is sold appear in the list. The chart displays data from the selected territory and product lines.
Developers can change or remove the automatic links. Users can enable Current Selections from the dashboard menu to see or clear all data selections on the dashboard.
Selecting a field to receive link data
When you link two gadgets together that use different data objects, you must match the published data field from the data selection gadget to a data field in the subscribing gadget.
For example, a list gadget shows product line names from a data set. A chart gadget shows sales results from a data cube in a different data object. The developer matches the different field names when linking the chart gadget to the list. This enables the list gadget to filter product line data in the chart gadget.
How to link to a data selection gadget
1 In a gadget menu choose link. Figure 34‑2 shows the gadget menu of a bar chart.
Figure 34‑2 Opening link options for a chart gadget
2 In Link, choose the data selection gadgets to link to.
*If the linked gadget displays values from the same data object as the chart, it links automatically to the default field.
*If the linked gadget displays values from a different data object than the chart, you can select the field to filter when data is selected.
Figure 34‑3 shows the chart linked to the Territory Office gadget and the Product Line gadget.
Figure 34‑3 Selecting a field to filter when the data selection gadget sends a value
3 Choose OK.
4 Select a value in each data selection gadget. The linked chart updates when the data selection value changes. Figure 34‑4 shows a chart linked to two data selection gadgets. Selections in the Territory Office gadget and the Product Line gadget filter the values displayed in the chart.
Figure 34‑4 Selecting a value to display in a chart