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.
- The application object sends invokeActionForRequest:inContext: (in Java, invokeAction) to itself; its implementation simply invokes the session object's invokeActionForRequest:inContext: method.
- The session sends invokeActionForRequest:inContext: to the request component.
- The component, in its implementation of invokeActionForRequest:inContext:, gets the template of the component and forwards the message to the template's root object.
- 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.
Table of Contents Next Section