How Server-Side Dynamic Elements Work
To learn how server-side dynamic elements work, look once more at the Main page of the CyberWind example in WebObjects Builder. If you switch over to raw mode, you see that the Main page contains this HTML code in its template:
Choose between the following menu options:<BR><BR> <WEBOBJECT NAME="OPTION_REPETITION"> <WEBOBJECT NAME="OPTION_LINK"> <WEBOBJECT NAME="OPTION_NAME"></WEBOBJECT> </WEBOBJECT> </WEBOBJECT>Each WEBOBJECT tag denotes the position of a dynamic element. Notice that the tag specifies only where the dynamic element should go; it does not specify the dynamic element's type. The type is specified in the .wod file:
OPTION_REPETITION:WORepetition { list = allOptions; item = currentOption }; OPTION_LINK:WOHyperlink { action = pickOption }; OPTION_NAME:WOString { value = currentOption };In the .wod file, each element is identified by name and then its type is specified. The outermost dynamic element in the HTML file (OPTION_REPETITION) defines a WORepetition, the next element is a WOHyperlink, and the innermost element is a WOString.
Each type specification is followed by a list of attributes. Dynamic elements define several attributes that you bind to different values to configure the element for your application. Usually, you bind attributes to variables or methods from your component's code (see Figure 12).
Table of Contents Next Section