The WOElement 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 WOElement; you must create a concrete subclass of WOElement and generate objects from it.
Note: For custom dynamic elements, you need to create a subclass of WODynamicElement
WOElement declares, but "nil" 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 (WORequest or WOResponse ). The second argument is a WOContext object that represents the context of the transaction.
Concrete subclasses of WOElement (or WODynamicElement) must, at minimum, implement appendToResponse:inContext:. Subclasses of WODynamicElement must implement one or both of the remaining methods.
This method is invoked in WOElements in the request-handling phase during which objects involved in the current transaction append their HTML content to the transaction's WOResponse object. If the WOElement has child WOElements, it should forward the message to them. WOElement's default implementation of this method does nothing.
See Also: WOResponse for methods used to append HTML content
This method is invoked in WOElements in the middle phase of request handling. 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 (in the 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 WOElement implementation of this method returns nil
See Also: WOContext class for a description of element IDs
This method is invoked in (dynamic) WOElements during the first phase of request handling. 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 variable bound to the attribute. In this way, even backend business objects are updated. The default WOElement implementation of this method does nothing.
See Also: WORequest class for methods used to extract form data