Show TOC

EventsLocate this document in the navigation structure

Use

You can define, fire and handle events during a portal request. The portal defines the following types of events:

  • Request Events: Events defined in the request URL. For example, you may have a component that displays a form that gets submitted to the same component, but with a slightly modified URL that includes a request event that indicates that the Submit button was clicked.

    For a request event named XXX , the portal tries to call doXxx(IPortalComponentRequest, IPortalRequestEvent) prior to content creation.

    If no such method exists, doRequestEvent(IPortalComponentRequest, IPortalRequestEvent) is called. The IPortalRequestEvent object contains the name of the event and any data.

    For information on generating a URL with a request event, see Creating URLs to Components .

  • Portal Object Model (POM) Events: Predefined events that occur during POM creation and content creation. For a list of events, see Request Flow .

  • Component Events: A POM node can fire an event to other nodes in the POM. The following is an example of firing a component event:

            IPortalNode myPortalNode = request.getNode().getPortalNode();
IPortalComponentEvent myEvent =
    myPortalNode.createPortalComponentEvent("myEvent");
myPortalNode.fireEventOnNode(myEvent,myNode);

         

For a component event named XXX , the portal tries to call doXxx(IPortalComponentRequest, IPortalRequestEvent) immediately.

If no such method exists, doComponentEvent(IPortalComponentRequest, IPortalComponentEvent ) is called. The IPortalComponentEvent object contains the name of the event and any data.

A node can filter the events it receives and choose to accept or reject each event. The method accept() is called on the node component before event handling occurs. If accept() returns true , the event is handled as usual; if false is returned, the event is ignored.