The event code is designed to provide an asynchronous notification mechanism that can be used to register for, and receive notification of, key events that happen asynchronously. The following terms are used with respect to events:
The event mechanism is implemented by two functions: registerForEvent and deregisterForEvent. Both functions have the same signature, taking an event ID as the first parameter and a callback function pointer as the second parameter.
The Fusion object provides two specific events that can be used by applications to get notification of when Fusion initialization has completed and when an error occurs anywhere in Fusion. These events are:
Components are designed to be completely independent of one another, allowing them to be added to, or removed from, applications with little or no impact on the other components in the application. However, there are cases (especially with the Map component) where it is important that components be able to communicate with other components or with the application as a whole. For these situations, there is an event mechanism that allows components and applications to register for and trigger events. The event mechanism allows components to be independent of each other, but still provide a high level of integration when required. For more information on the events supported by the Map component, see and .
To register a callback function for a component event, the application must first obtain a reference to the component through one of the methods of the Fusion object (typically getWidgetById) and then call registerForEvent passing one of the event IDs that is valid for that component.