Portlet Factory, Version 6.1.2


 

About firing events

If you have an event declared, you can fire that event.

You can call either the fireEventName or the fireTargetedEventName method added to the WebApp by the Event Declaration builder call.

You can target an event towards a particular model by calling the fireTargetedEventName method and specifying a WebAppAccess object for the target model and any arguments defined in the event declaration. In the target model, include an event handler which specifies an action that processes the arguments passed and executes some model action.

Note: Widget events (created with the Widget Event builder) cannot be targeted. iWidget events are always broadcast to all registered listeners.

You can target an event to the following locations (these names correspond to String constants in com.bowstreet.webapp.WebAppAccess):

EVENT_TARGET_ALL

Target the event to all models. Each model receives the event. If it has a matching event declaration and an event handler, the event is processed.

EVENT_TARGET_PARENT

Target the event to the parent of this model, which can be the model that contains this model or links to this model.

EVENT_TARGET_SELF

Target the event to this model. No other models receive notification of the event occurring.

An instance of the WebAppAccess object for the target model

Target the event to a specific model. Use the webAppAccess.getModelInstance() method to retrieve the WebAppAccess object for another model.

Parent topic: Overview: handling events


Library | Support |