Object Rexx code can be embedded in pages to control the behaviour of forms, to update the page before it is sent, and to define additional methods. There are three types of code insert:
OnSubmit: Code inside an
OnSubmitcontainer is obeyed whenever the surrounding form, active link or imagemap is submitted or clicked on. If the code is inside a form, it can get the data contained in the form's fields by referring to their
valueattribute. The x,y coordinate on an imagemap can be got similarly.
Behaviour: Code inside a
Behaviourcontainer is obeyed every time the page is sent back by the server. More precisely, whenever the server is asked for a page from a particular application, it executes the
Behaviourcode of all instances in that application, doing so in a depth-first fashion from the root. This ordering can, as described in Section 6 occasionally cause problems, but works pretty well in general.
Methods: Method definitions inside a
Methodscontainer are added to the methods of the class generated from the page, as we saw with the factorials example. They are only executed if explicitly called from a code insert.