Linking and scripting gadgets : Building gadget links : Using multiple user selections
 
Using multiple user selections
When multiple data selection gadgets link together, each gadget updates to display a subset of all user selections. Each user selection also updates linked visualization or report gadgets.
For example, consider a chart gadget linking to two data selection gadgets; a list gadget displaying country names and a list gadget displaying city names. If the user selects a country, then the city list updates to show cities in the country and the chart gadget displays data about the country. If the user selects a city, then the country list updates to show the country containing the city and the chart gadget updates to displays data about the city.
The Show Selections gadget from the dashboard menu can clear all data selections on the dashboard at the same time.
Building one-way cascading selections
Two or more data selection gadgets can link to each other to show subsets of their displayed values. Gadgets link automatically when using the same data object on the same dashboard. Editing the gadget links enables you to limit which user selections can update other gadgets.
For example, a list gadget showing customer names and a list gadget showing order numbers link to each other. When the user selects either a customer name, or customer order number, the other gadget updates its displayed values. Removing the link from the customer name list to the order number list stops the customer name list from updating. The order number list remains linked to the customer name list. Changes to the customer name list continue to change the order number list.
Updating from a single selection
Use gadget links to control which user selections can update the displayed data. For example, you want to update the chart only when the user selects a city, the automatic links must be removed and replaced by two links:
*Link the chart gadget to the list showing cities.
*Link the list showing cities links to the list showing countries.
Figure 6‑4 shows cascading user selections displaying values to the user. When the user selects a country, only the list gadget displaying cities is updated. When the user selects a city, the chart gadget is updated. Alternatively, the user can immediately select a city name.
Figure 6‑4 Cascading user selections