|
WebObjects 5.2.3 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.webobjects.appserver.WOElement
The WOElement class is the abstract superclass of all objects that represent static and dynamic UI elements on a template page. Examples would be XML, HTML, WAP, PDF, etc... 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 the three methods corresponding to the phases of the request-response loop (invoked in the following order), but WOElement's implementations do nothing:
takeValuesFromRequest(WORequest aRequest, WOContext aContext)
invokeAction(WORequest aRequest, WOContext aContext)
appendToResponse(WOResponse aResponse, WOContext aContext)
The first argument of these methods 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
. Subclasses of WODynamicElement
must implement one or both of the remaining methods.
takeValuesFromRequest(WORequest aRequest, WOContext aContext)
,
invokeAction( WORequest aRequest, WOContext aContext)
,
appendToResponse(WOResponse aResponse, WOContext aContext)
Constructor Summary | |
protected |
WOElement()
Returns an initialized WOElement. |
Method Summary | |
void |
appendToResponse(WOResponse aResponse,
WOContext aContext)
This method is invoked in WOElement objects in the request-handling phase when objects involved in the current transaction append their HTML content to the transaction's WOResponse object. |
WOActionResults |
invokeAction(WORequest aRequest,
WOContext aContext)
This method is invoked in WOElements in the phase of request handling that results in the triggering of an action method and the return of a response WOComponent. |
void |
takeValuesFromRequest(WORequest aRequest,
WOContext aContext)
This method is invoked on WOElement objects during the phase of request handling that extracts user-entered data. |
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
protected WOElement()
Method Detail |
public void appendToResponse(WOResponse aResponse, WOContext aContext)
aResponse
- the input HTTP request to trigger the append actionaContext
- the context of the transactionWOResponse
public WOActionResults invokeAction(WORequest aRequest, WOContext aContext)
To see if it has been activated, the dynamic
element should check the current element ID (obtained from the WOContext)
against the sender ID in the request. Because each of the three phases of
the request-response loop is traversing the same graph of objects in the same maner,
the WOContext-incremented element IDs are assured to always match between phases.
Therefore a dynamic element's ID generated in appendToResponse
will be
reached again for the same dynamic element in the two other phases.
Note: invokeAction
is the only phase where it is safe to bypass children or subsequent elements.
It is not necessary to call super.invokeAction
.
after invoking the action, the dynamic element should just return the value of the action.
aRequest
- the incoming HTTP request to trigger the actionaContext
- the context of the transaction
null
. If the last element of the page returns null
,
WebObjects just redisplays the page.WOContext
public void takeValuesFromRequest(WORequest aRequest, WOContext aContext)
Any WODynamicElement implementing this method can acquire incoming data (such as HTML form data from the WORequest) or changed state (such as a check in a check box) associated with one of their attributes and assigns the value to the WOComponent variable bound to the attribute. The current WOComponent is always accessible through the passed WOContext. In this way, back-end business objects are updated. The default WOElement implementation of this method does nothing.
aRequest
- the HTTP requestaContext
- a WOContext object that represents the
context of the transactionWORequest
public String toString()
|
Last updated Thu Oct 21 15:04:16 PDT 2004. | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |