Skip to main content
The UI Kit provides two levels of event handling: component-level callbacks set directly on a View instance, and global events registered via static listener methods on event classes.

Component-Level Callbacks

Click Callbacks

Error Callback

Use setOnError to handle component-level errors:

Selection Mode

Enable single or multi-select on list components:

Global Events

Global events are fired by the UI Kit when actions happen anywhere in the app. Register listeners using the static listener registration methods on each event class (addListener, addGroupListener, or addUserListener depending on the class). Each listener is registered with a unique String tag so it can be removed later.

Component-Level vs Global Events

  • Component-level callbacks (e.g., setOnItemClick) are set on a specific View instance and only fire for that component.
  • Global events (e.g., CometChatMessageEvents.addListener) are static and fire regardless of which component triggered the action. Use them for cross-component coordination.