During this course you will use Domino Designer 8 to add JavaScript to Domino applications that are accessed by browsers. The course covers the basic language elements of JavaScript, how to add scripts using Domino Designer, and how to exploit the various browser and language object event handlers. There is a strong emphasis on the browser object model and how it relates to the Domino object model. The course also touches on how to incorporate Dynamic HTML, Java Applets, LiveConnect, ActiveX controls, and AJAX into web-based applications.
Cost: Price on application
Duration: 3 days
This course is not available as part of our public schedule but can be provided on a customised client specific basis.
Prerequisites:
- thorough knowledge of the Domino Designer 8 development environment, including Form, Page, View, Frameset, and Agent design, as well as how to set properties and set the ACL
- knowledge of Web technologies, including servers, browsers, HTML, Cascading Style Sheets, and some basic JavaScript (or other browser scripting language) and awareness of browser object properties and methods
- basic understanding of LotusScript and the various Notes product objects
- because this course does not review any aspects of the non-JavaScript aspects of developing applications with Domino Designer, mastery of the topics covered in these courses:
- Lotus Domino Designer 8: Basic Notes Applications
- Lotus Domino Designer 8: Basic Browser Applications courses
Browser Objects and JavaScript :
Preview of the Domino/browser exchange
Programming challenge
The history of client-side scripting
Brief history of browser object models
Launch browser from Lotus Notes
Browser Object Model (DOM Level 0)
JavaScript vis-a-vis browser objects
Mozillas DOM and JavaScript object Inspector
Domino as a Web server
The Domino "Web Server"
Third-party Web server plug-ins
Exercise: Create project databases
Coding JavaScript in Domino Designer :
HTML page structure
Code your own HTML
Other sources of HTML
Getting JavaScript into the HEAD tag
Exercise: JavaScript function
Getting JavaScript onto an HTML page
Exercise: Create a button
Troubleshooting button problems
JavaScript libraries
JS files on Pages
JavaScript library security
Syntax checking
Runtime error reporting
Microsoft Script Editor
Mozilla JavaScript Debugger
Commercial debuggers
Home grown debugging
Basic Language Elements :
Walkthrough: Basic elements
Simple data types
Built-in functions
var keyword and variable scope
Simple dialog boxes
Commented code
Exercise: Dialog boxes
try/catch statement
throw statement
Custom error object
Garbage collection
Branching and Looping Structures :
If structure
Exercise: If structure
Boolean operators
Exercise: Boolean operator
Simple if using ?
Switch
While structure
Do while structure
For structure
Break
Continue
Exercise: Looping structures
Custom Functions :
Function statement
Function arguments
How to call a function
Where to call a function
Return a value from a function
Exercise: Function to test number
Passing argument by value
Recursive functions
Conversion of @Commands to JavaScript functions
JavaScript Objects :
Date object
Browser or Domino Server time?
Create date object
Domino-acceptable date entry
Exercise: Date object
Math object
Number object
String object
String object parsing methods
Regular expressions
Simple examples
Valid number
Intermediate example: Replace
Advanced example: Patterns and literals
Exercise: Fix URL function
RegExp (regular expression) object
Screen object
Custom objects
forin statement
with statement
delete operator
Custom object prototyping
Example: Custom class
Example: Add method to JavaScript object
Enumerator object
Arrays :
Array attributes
How to declare an array
Create array from @DbColumn
Number of elements
Append elements
Read one element
Read all elements
Out-of-bound errors
Copy entire array
Array object methods
Delete element
Find values in an array
"Multi-dimension" arrays
Associative arrays
Exercise: Parse URL command string
Parse URL command string using formula
Unique array elements
Object Literal
Nested Literals
Browser Object Model :
Browser object hierarchy
Browser object browser
Table of browser objects
Traverse the hierarchy
Example: Access Form object
Example: Access Field object
Chaining object references
this keyword
self keyword
Help with the Browser Object Model
Exercise: Accessing a Field object
Browser object and Domino object interaction
Example: Form processing
Browser object to Domino object limitations
Browser Event Handlers:
Possible events
Event handler basics
Commonly-coded events
Walkthrough: Investigate event handlers
Capture key presses
Example 1: Capture key presses
Example 2: Capture ESC and double-click
Event handler registration
this keyword
Object event default actions
Coding the javascript: pseudo-protocol
Coding javascript: in a formula
Field Access :
HTML field data type
Text field access
with statement
JavaScript access to Computed/Hidden Fields in Edit mode
tag and Fields
JavaScript access to Computed/Hidden Fields in Read mode
Parsing a multi-value Field into an array
Field Input Translation and Validation:
Field-level help
Field translation
Field validation
Test data type
Validate for number
Test for NaN
Test for "null" and "undefined" and ""
Validate for file attachment name
onblur, alert, and focus interactions
Select field validation
Radio and check box validation
String format validation
Date validation with JavaScript
Handling leap years
Forcing valid date entries
Field computation
When you must use Server-side input translation/validation
Example: Server-side input validation
Date validation via @Functions
Exercise: Recalc using JavaScript
Form Validation :
Field-level event handler caveats
"Object is not defined" error
onsubmit event handler
Keep the
Window Object :
Open window using HTML
Open window using JavaScript
Hybrid HTML Link/JavaScript link
Window features
Referring to windows
Cross-domain script security restriction
Focus on a window
Print window
Write to window
Resize, move window
Close a window
Window opener property
Exercise: Help window
Custom dialog boxes
Simulating @Picklist using standard window.open
Simulating @Dialogbox with a modal dialog box
Address book lookup dialog box
setTimeout method
window.find
clipboardData object
Frame Object :
Frames are windows
Frameset basics
Support browsers that dont support Frames
Example frameset
Targeting frame content using HTML
Dynamic frames from JavaScript
Call a function from another frame
Exercise: Help frame
Example: On-Form help frame
IFrame Object
Location Object:
Location is where you are
Database properties
Location properties
Location object versus CGI variable
Set location to the current database
URL encoding
Setting the location
Replacing the location
Example: ESC and Double-click
Refresh/Reload a window
Working with frame locations
Redirection
Redirection to user mail
Redirect to SSL connection
Manual redirection: "Menu Options"
Menu Option 1: Select with button
Menu Option 2: Select w/o button
Exercise: Page chooser
Prevent from being framed
Frame your pages
Invalid URLs and buffer overflows
Browser State Persistence :
Who is the user?
What is a cookie?
Privacy issues
Set cookie using META tag
Read cookie using CGI variable
Weaknesses of HTTP/HTML methods
Set cookie using JavaScript
Example: Set cookie
Get cookie using JavaScript
Set cookie using formula
Parse cookie values
Delete cookie
Exercise: Default Field values using cookie
Profile documents
Profile documents and security
Create Profile document
Read from Profile document Fields
Example: Profile document
Behaviors and data persistence
Userdata and IE security
Example: Userdata
Dynamic HTML :
DOM Level 1 enhancements
DOM Level 1 hierarchy
Element nodes
Browsing the node hierarchy
Mozillas DOM and JavaScript object Inspector
Instantiate a node object
Example: Instantiate Subject Field
Get and set Field value
Set Field style properties
Element object shortcut
TextNode objects
Node event handlers
DHTML examples
Example: Change style sheets on Form load
Example: Change style sheets on the fly
Example: Reset style on elements
Example: Hide When
Example: Expand all sections
Example: Disable element
Exercise: Disable element
Tables
Element positioning
Date picker
Field input mask behavior
JavaScript and Java Applets :
Java and Domino
Import/embed single file Java applet
Embed applet with parameters
Import/embed multiple file applet with parameters
Applet parameters
Shared Applet Resource
LiveConnect
Applet access to JavaScript objects
Date picker Java applet
Domino applets
Exercise: Editor Java applet
lotus.domino.AppletBase applet
How the lotus.domino.AppletBase applet works
Domino Server settings
Client settings
How to embed the lotus.domino.AppletBase applet
Accessing Domino objects via JavaScript
Java Console
Common errors with lotus.domino.AppletBase
Domino Views :
$$ViewTemplateDefault as redirector
JavaScript function calls in column formulas
Exercise: JavaScript in column formula
HTML check boxes in Views
Document processing in applet View
Alphabetic index
Search from View
JavaScript and ActiveX Controls :
ActiveX and security
Example 1: Shockwave not scripted
Example 2: Flash - scripted
Example 3: Windows Media Player
Example 4: Calendar control
Example 5: Run methods in embedded Editor control
Asynchronous JavaScript and XML :
AJAX rediscovered
GET data from Domino
POST data to Domino
XMLHttpRequest object
XMLHttpRequest object example
XMLHttpRequest and security
Limit and control data from view
JavaScript Object Notation (JSON)
XML document transformation
Other examples of using Domino XML output
Browser Compatibility :
What browsers are being used?
The issues
Code strategies
Server-side branching with @BrowserInfo
@GetHTTPHeader
Client-side browser type/version detection
Detect browser type/version using CGI variable
Hide JavaScript from non-compliant browsers
JavaScript version detection
Client-side object detection
Case Study: "Layers"
Programmatic access to "layers"
Cross-browser coding
The problem with either type of browser detection with JavaScript