The BI Beans thin beans render HTML, and that HTML includes hyperlinks that users can click. When a user clicks one of these hyperlinks, an event is sent to the servlet. The servlet must route the event to an appropriate handler for the event.
Events are handled by one of the following:
The bean that rendered the event -- Much of the time, the bean that generated the HTML for an event also handles the event. For example, the thin crosstab gets the drill event that is generated when a user clicks a drill icon. The crosstab handles the request by rendering HTML that displays the drilled data.
A bean other than the bean that rendered the event. Some beans generate events that other beans should handle. For example, the SaveOptions
dialog renders a Save event that a thin presentation bean handles. You set an event target for these events, to specify the bean that should handle the event.
Your servlet application code. For example, when a thin dialog generates a cancel event, then your code must handle the event. To do this, you can set an event target to direct the event to a named class in your application code, and then check the source query parameter for the class name that you set in the event target.
Your servlet can also be the ultimate handler of an event by adding event listeners to the beans that first get the event. For example, your servlet can handle a drill-out event by adding a listener to the thin table or the thin crosstab that receives the event.
When a thin bean handles an event, the event can change the state of the thin bean. These state changes are important if you plan to support bookmarks or the use of the Back button in your HTML-client application. You should be careful to manage the state of the thin beans.