PROGRAMMING OVERVIEW AND USER INTERFACE
You code the same event twice; once for the Notes client platform and once for the Web platform.
Note The separate handling of Notes client and Web browser events is new for Release 6. See "Compatibility issues" below. The one exception to the 'coding same event twice' rule is with actions and shared actions. If you are designing in Release 6 and running in Release 5, you must code two separate actions, one for each platform. Use the hide-when formulas to hide an action from Notes or Web platforms.
Web events can be coded only in JavaScript. You can specify the same JavaScript code for both a Web event and its corresponding Notes client event.
The following table lists the events that can be handled using the formula language, LotusScript, JavaScript and Java code in the Notes client and Web browser environments. Non-programming handlers such as simple actions are also listed. For information on sequencing of events, see the table "Event sequencing." For information on the user interface, see "Exploring the Programmer's pane" and "Using the Objects tab."
Picture Hotspot LotusScript Script Library Subform View
Note Preferred is onFocus
Note Preferred is onBlur
Note New with Release 6
Note New for LotusScript with Release 6
Note New for Formula and LotusScript with Release 6
Note Preferred is onLoad for Form and Page
Note Preferred is onUnload for Form and Page
Note Preferred is onSubmit for Form
@Command([ToolsRunMacro];"agentname")
LotusScript subroutines and functions
You can add LotusScript subroutines and functions to an object. Your scripts are added to, and can be selected from, the list of events belonging to the object.
LotusScript Declarations and Options areas
Each object has a Declarations area where you can write non-executable LotusScript statements that apply to all LotusScript events in the object, and an Options area for statements such as Option, Use, UseLSX, and Const. Each form, folder, page, subform, and view has a Globals area where you can write non-executable LotusScript statements that apply to all LotusScript events in the object.
Current document in onLoad and PostOpen
Changes made to the current document in an onLoad or PostOpen event are treated as default values. The document is not marked as changed. If the user closes the document at this point, the onLoad or PostOpen changes are lost. You must explicitly save the changes, for example, with the Save method of NotesUIDocument, if you want to be sure they are applied.
Compatibility issues
In Notes Release 5 certain JavaScript events occur on the Notes client as well as the Web browser. In addition, Formula/LotusScript events that respond to the same user actions also occur on the Notes client. For example, both the onBlur and Exiting events occur when the Notes client user exits a field.
Release 6 distinguishes between the application of events to the Notes client and Web browser. You code one JavaScript or LotusScript event for the Notes client and a separate JavaScript event for the Web browser. Those JavaScript events that occur on the Notes client in Release 5 allow LotusScript and in some cases Formula in Release 6. The corresponding LotusScript-only events still occur, but their continued use in Release 6 applications is discouraged.
The following table lists the affected events:
In Notes Release 5, for example, if you code the onBlur event for FieldOne as follows:
To duplicate this functionality in Release 6, you specify the code twice, once for the onBlur - Web event and again for the onBlur - Client event, or specify the code under "Common JavaScript."
If, in addition to coding onBlur, you code the Exiting event for FieldOne as follows:
In Release 6, if backwards compatibility is not an issue, you should combine the code in the onFocus - Client event and remove the Exiting event. You can code in JavaScript:
Notes Release 5 applications running in the Release 6 Notes client behave the same. Those JavaScript events that worked in the Notes client continue to work on both the Web and the client. The LotusScript PostOpen, QueryClose, QuerySave, Entering, Exiting, and Click events continue to work.
When a Release 5 application is saved in Release 6 Domino Designer, JavaScript events are moved into their corresponding Web and (where applicable) Client events. The LotusScript events remain. For example, the onBlur event is moved into the onBlur - Web and onBlur - Client events, and the Exiting event remains.
However, if backwards compatibility is not an issue, you are urged to revise the code in the following cases:
Release 6 applications running in the Release 5 Notes client behave the same as in the Release 6 client except that events new to Release 6 do not work in R5. For example, onLoad - Client for LotusScript does not work in Release 5.
If you recompile an Release 6 application in Release 5, JavaScript client events are lost and JavaScript Web events are reinstated for both client and Web. For example, onLoad - Client for JavaScript disappears if compiled in Release 5. JavaScript - Web does not disappear if compiled in Release 5 but now works for both client and Web.
Therefore a caveat exists to the guidelines for forward compatibility. If you continue to design in both Release 5 and Release 6, you should keep the LotusScript PostOpen, QueryClose, QuerySave, Entering, and Exiting events, not use the LotusScript "on" events, and code the JavaScript events for both client and Web (use "Common JavaScript").
onHelp and HelpRequest
In Release 5 the HelpRequest event (Formula) performs your action and suppresses standard help when the user presses F1 in the Notes client. The onHelp event (JavaScript) performs your action and (in addition) calls standard help when the user presses F1 in a Web browser.
In Release 6 the onHelp - Web event is the same as the Release 5 onHelp event. The onHelp - Client event, which supports Formula, LotusScript, and JavaScript, has the behavior of HelpRequest in Release 5. HelpRequest is gone from form design.
See Also