Building custom gadgets : Linking Google gadgets : Linking public Google gadgets

Linking public Google gadgets

Google gadgets that the dashboard designer does not own and can not modify, can receive user selections if the gadget uses the pubsub feature. The dashboard designer adds a script to the import gadget that displays the Google gadget. This script changes the link channel name to match the channel name of the Google gadget.

For example, the dashboard designer looks at the XML code of the Google gadget and sees the following code:

gadgets.pubsub.subscribe("MY_PERSONAL_GOOGLE_GADGET", onEventChange);

The channel name used by this Google gadget is MY_PERSONAL_GOOGLE_GADGET.

The dashboard designer then links to a data selection gadget, such as a list gadget, and adds a script to the link settings to match the channel name used in the Google gadget. The following code shows an example of this script, changing the name of the event to MY_PERSONAL_GOOGLE_GADGET.

data.event = "MY_PERSONAL_GOOGLE_GADGET";

When the user makes a selection from the list gadget, the import gadget changes the channel name and passes the message to the Google gadget.

For more information about adding script to a linking gadget, see Scripting linked gadgets.


(c) Copyright Actuate Corporation 2011