MicroStrategy ONE
Handling Event-based Requests
The WebComponent interface provides methods for supporting events or user requests. Every user interaction is abstracted as an event.
Each user request is first sent for processing to the Web Component that generated the event. Consider the example of an user changing a formatting option in the Formatting Editor. In this case, if the highest-level component cannot handle the event, it passes the event through its children in the order they were defined until it finds the component capable of handling the event.
Any object that extends WebComponent can have a WebEventHandler associated with it. The WebEventHandler is capable of generating and handling a set of WebEvents. If necessary, a Web Component itself can be designed to handle a WebEvent.
In the MicroStrategy Web product, any time a WebComponent is found not to employ an event handler, the handleRequest(RequestKeys) method is used to handle an incoming event request. The RequestKeys contain information about parameters passed as part of a request, including WebEvents, such as event IDs and arguments. In performing customization in the MicroStrategy Web product's environment, you may choose to manually add, remove, or extract keys to the RequestKeys collection.
The handleRequest(RequestKeys) method returns "true" if the request is handled. The value is "false" if the current Web Component decides not to handle it. Any backend error which occurs while the request is being handled is returned as a WebBeanError instance. This method throws WebException, if anything expected in the RequestKeys by this component or its event handlers is wrong.