IBM Support

Naming the event handler function so that an ICM page widget can automatically handle a broadcast event without event wiring

Technical Blog Post


Abstract

Naming the event handler function so that an ICM page widget can automatically handle a broadcast event without event wiring

Body

The ability to create custom UI widgets and add them to the IBM Case Manager Client pages is a very powerful feature. Not only do these widgets display whatever information the solution requires, they can do it in the context of the other information that Case Manager is displaying. This capability is provided by an extensive event mechanism where event payloads can be either directly wired between individual page widgets, or broadcast to any other widgets who may be designed to listen for a specific event.

For each event that is handled by your page widget, you must define an event handler function in the page widget class. To expose that event as one that can be manually wired to other widgets, you define an entry in the widget's registration file. But what if you want to have your handler called when one of the standard broadcast events occurs?

Assume that your page widget needs to handle a broadcast event that is named XXX.YYY. To ensure that the event is handled automatically without the need to add any manual event wiring, you must use the following convention for naming the event handler function:

  • Add the word "handle" as a prefix to XXX.
  • Convert the dot (.) to an underscore (_).
  • Append the word "Event" to the name.

The resulting name for the event handler function is: handleXXX_YYYEvent. 

The parts of the function name that are derived from the event name are case-insensitive and do not need to be in the same case as the event name.

The following table provides examples of how this naming convention is applied to event handler functions:

Event name

Event handler function name

icm.ClearContent

handleICM_ClearContentEvent

abc.FieldUpdated

handleABC_FieldUpdatedEvent

zz.Refresh

handlezz_RefreshEvent

 

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSCTJ4","label":"IBM Case Manager"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

UID

ibm11281394