Notifications"
Line 5: | Line 5: | ||
There are three ways to notify: widget events (<javadoc directory="jsdoc">zk.Event</javadoc>), DOM events (<javadoc directory="jsdoc">jq.Event</javadoc>) and client activity watches. | There are three ways to notify: widget events (<javadoc directory="jsdoc">zk.Event</javadoc>), DOM events (<javadoc directory="jsdoc">jq.Event</javadoc>) and client activity watches. | ||
− | A | + | A DOM event (Event) is the DOM-level (i.e., low-level) event that is usually triggered by the browser. It is usually listened by the implementation of a widget, rather than the client application. |
− | A | + | A widget event is the high-level event. It is used either to encapsulate a DOM event, or to represent a notification specific to a widget, or to an application. |
+ | |||
+ | It is generally suggested to listen widget events (rather than DOM events) if possible, since it is easier and more efficient. | ||
A client activity watch is a notification for special activities that are not available as DOM events or widget events. For example, the notification when a widget is becoming invisible. | A client activity watch is a notification for special activities that are not available as DOM events or widget events. For example, the notification when a widget is becoming invisible. |
Revision as of 07:15, 20 December 2010
In this section we discuss the notifications at the client side.
There are three ways to notify: widget events (Event), DOM events (Event) and client activity watches.
A DOM event (Event) is the DOM-level (i.e., low-level) event that is usually triggered by the browser. It is usually listened by the implementation of a widget, rather than the client application.
A widget event is the high-level event. It is used either to encapsulate a DOM event, or to represent a notification specific to a widget, or to an application.
It is generally suggested to listen widget events (rather than DOM events) if possible, since it is easier and more efficient.
A client activity watch is a notification for special activities that are not available as DOM events or widget events. For example, the notification when a widget is becoming invisible.
They are mainly used for component development. Application developers rarely need it. For a complete reference, please refer to JavaScript APIs.