Class next.wo.Element

CLASS DESCRIPTION

Extends:
next.util.NextObject

The Element class is the abstract superclass of all objects that represent static and dynamic UI elements on a World Wide Web page (currently, HTML and PDF elements). You cannot directly instantiate objects from Element; you must create a concrete subclass of Element and generate objects from it.

Note: For custom dynamic elements, you need to create a subclass of DynamicElement.

Element declares, but "null" implements, the three methods corresponding to the phases of the request-response loop (invoked in the following order):

The first argument of these messages is an object that represents the HTTP request or response (Request or Response ). The second argument is a Context object that represents the context of the transaction.

Concrete subclasses of Element (or DynamicElement) must, at minimum, implement appendToResponse. Subclasses of DynamicElement must implement one or both of the remaining methods.


METHODS

appendToResponse

public void appendToResponse(next.wo.Response aResponse, next.wo.Context aContext)

This method is invoked in Element objects in the request-handling phase when objects involved in the current transaction append their HTML content to the transaction's Response object. If the Element has child Elements, it should forward the message to them. Element's default implementation of this method does nothing.

See Also: Response for methods used to append HTML content


invokeAction

public next.wo.Element invokeAction(next.wo.Request aRequest, next.wo.Context aContext)

This method is invoked in Element objects in the phase of request handling that results in the triggering of an action method and the return of a response Component. In this phase, the message is propagated through the objects of the application until the dynamic element for the activated HTML control (for instance, a custom button) responds to the message by invoking the method in the request component that is bound to the action. To see if has been activated, the dynamic element should check its element ID (obtained from its Context) against the sender ID in the request. To invoke the action method, the dynamic element should return the value of the action. The default Element implementation of this method returns null

See Also: Context class for a description of element IDs


takeValuesFromRequest

public void takeValuesFromRequest(next.wo.Request aRequest, next.wo.Context aContext)

This method is invoked in (dynamic) Element objects during the phase of request handling that extracts user-entered data. Each dynamic element acquires any entered data (such as HTML form data) or changed state (such as a check in a check box) associated with an attribute and assigns the value to the Component variable bound to the attribute. In this way, even backend business objects are updated. The default Element implementation of this method does nothing.

See Also: Request class for methods used to extract form data