Main Menu
Lecture 1
Lecture 3
Lecture 4
Lecture 5
Lecture 6
Lecture 7
 

 

 

Bindings

Bindings use keys to access component values

A key is a string that is the name of a variable or method in the component.

Keys are bound to attributes of dynamic elements (through the .wod file)

When a dynamic element needs a value for an attribute it asks the component to return the value for the key bound to that attribute.

The component sends itself a message with the same name as the key -

e.g. date()when page is loaded

or reload() when hyper link is clikced

or setUser(me) when user pushes submit button to submit the form

If there is no method with that name in the class the component looks for an instance variable with that name.

If none is found WO returns an error page.


Binding Restrictions

Dynamic elements have several attributes that can be bound

Mandatory

required for the element to work

e.g. value attribute for WOString and WOTextField

Optional

change the way the element operates

e.g. formatting the output string

Mutually Exclusive

attributes that provide the same information

e.g. pageName attribute of a WOHyperLink specifies the name of the component the link should display

action specifies a mehtod that will return a component instance

href specifies the URL

WOInspector diaplays any incorrectly bound attributes in red

  • click on warning button to display specific error or
  • view help file by clicking doccument button