Text Documents (Writer)
HTML Documents (Writer Web)
Spreadsheets (Calc)
Presentations (Impress)
Drawings (Draw)
Database Functionality (Base)
Formulae (Math)
Charts and Diagrams
Macros and Scripting
Office Installation
Common Help Topics
OneOffice Logo

HTML Filters and Forms

You can use all control elements and form events in HTML documents. There have been numerous events to date (for example, focus events), which have not been changed. They will continue to be imported and exported as ONFOCUS, ONBLUR, and so on for JavaScript and as SDONFOCUS, SDONBLUR, and so on for Office Basic.

Generic names that consist of the Listener interface and the method name of the event are used for all other events: An event registered as XListener::method is exported as

SDEvent-XListener-method = "/* event-code */"

Note that the XListener- and method components of this option are case-sensitive.

Event handling of controls is performed using the Office API. If you assign an event to a control, an object registers itself internally as a "Listener" for a specific control event. To do this, the object must use a specific interface, for example the XFocusListener Interface, so that it can react to focus events. When the event occurs, the control then invokes a special method of the Listener interface when the control receives the focus. The internally registered object then invokes the JavaScript or Office Basic code, which was assigned to the event.

The HTML filter now uses precisely these listener interfaces and method names so that it can import and export events as desired. You can register a focus event through

rather than through the

register. Events can therefore be registered as desired, including those not offered in the list boxes. To define the script language of events, you can write the following line in the document header:

As CONTENT you can, for example, use "text/x-StarBasic" for Office Basic or a "text/JavaScript" for JavaScript. If no entry is made, JavaScript is assumed.

During exporting, the default script language will be defined based on the first module found in macro management. For events, only one language can be used per document.