Documentation Archive Developer
Search
Table of Contents Previous Section

Invoking an Action

In the second phase of the request-response loop (see Figure 23), the application first determines which dynamic element the user has clicked (or otherwise activated) and then has that element trigger the appropriate action method in the request component. This method returns the response page-the component responsible for generating an HTTP response. If the user has not triggered an action, the request component is used as the response component.

Figure 23. Invoking an Action

Here is the basic sequence of events for invoking an action:

  1. The application object sends invokeActionForRequest:inContext: (in Java, invokeAction) to itself; its implementation simply invokes the session object's invokeActionForRequest:inContext: method.

  2. The session sends invokeActionForRequest:inContext: to the request component.

  3. The component, in its implementation of invokeActionForRequest:inContext:, gets the template of the component and forwards the message to the template's root object.

  4. Suitable dynamic elements in the request-page template and in subcomponent templates handle the invokeActionForRequest:inContext: message and invoke the appropriate action method in the request component. This action method returns the response page.

    To be suitable, an element must be able to respond to user actions (a WOSubmitButton or a WOActiveImage, for example). Each of these elements evaluates the invoked action to determine if it "owns" it.

For more on how components are associated with templates and on how HTML elements participate in request-handling, see "How HTML Pages Are Generated".

Table of Contents Next Section