Portlet Factory, Version 6.1.2
Overview: handling events
Your model can use events to trap and process different types of events. Your model can process the following types of events:
When firing an event, your model can send data and can broadcast that a particular action has occurred.
System events
All models support the following predefined system events:
- System: OnWebAppLoad
- Fired each time a new instance of the model WebApp is instantiated for a session.
- System: OnRequest
- Fired each time an external request is made (typically, from a browser) to the WebApp.
- System: OnUnhandledError
- Fired when an error occurs and is not handled by an explicit error handler.
- Page:pageName:OnPageLoad
- Fired each time the specified page is requested. Each page in the model gets its own OnPageLoad event declaration.
To process any of these events, add an Event Handler builder to the model and specify the action to perform when the event occurs.
User events
As the user interacts with the HTML controls of your application, you can process those events with the HTML Event Action builder. This builder monitors a specified HTML control (added to the page by another builder) and performs an action when the specified event occurs. For example, to submit a form when the user clicks on a link, use the HTML Event Action builder call.
Declared events
You can declare application-specific events by adding an Event Declaration builder to a model. The Event Declaration builder adds a fireEventName method to the model that allows you to fire the event. Any models that have an identical Event Declaration builder call (either added directly or indirectly with an imported model) can handle that event.
Widget events
A Widget event is a special event that is handled by widgets in IBM® Lotus® Mashups. Create widget events using the Widget Event builder.
Parent topic: Developing Web applications
- Declaring events
You can declare events for your application by adding one or more Event Declaration builder calls to your model.
- About handling events
Add an Event Handler builder to your model to handle events declared in the model.
- About firing events
If you have an event declared, you can fire that event.
- Passing arguments to actions
The Input Mappings group allows you to specify argument names and values to pass to an action.
- Passing arguments to an event handler
IBM WebSphere Portlet Factory can pass arguments to an event handler by specifying that an event accepts arguments in the appropriate builder call and supplying those arguments when you call the fireEventName method.
Library | Support |