|
|
|
|
|
|
|
|
|
|
|
|
|
|
Implementing dynamic drop-down menus using Domino and Internet Explorer (continued)
Getting there is a bit fiddly, mainly because there are lots of bits and pieces required to get a working solution together. None of the individual tasks are difficult though.
Here's the way it works:
- A two-column Notes view provides the raw data. Column one corresponds to field A value, column two corresponds to field B value.
- When the Domino form is loaded, a WebQueryOpen agent is triggered. This agent grabs the contents of the columns of the Notes view. The agent formats the columns to appear as a JavaScript array and outputs to a field on the domino form.
- The field on the Domino form is inside a pair of HTML <script> tags, so the Notes view values become values within the JavaScript keyword array.
- The Domino form contains field A (the "Manufacturer" field) and field B (the "Model" field).
- The form contains a JavaScript function that clears field B of its values and then reloads it with a new set of values corresponding to the current value of field A. When the HTML page is loaded into the Web browser, the function is automatically triggered by an "onload" event in the HTML header.
- Field A's HTML attributes contain an "onchange" event that triggers when the field value is changed. This calls the JavaScript function that updates field B to contain the appropriate values corresponding to the current value of field A.
Constructing the demo: overview of the steps To construct the demonstration we will carry out the following steps:
- Create a new Domino database;
- Create the form;
- Create the fields;
- Create the JavaScript function that updates field B;
- Create the view containing the raw data;
- Create the agent;
- Create the field that will hold the JavaScript keyword array and place it within the <script> tags;
- Create an "onload" event in the HTML header;
- Add the agent to the "WebQueryOpen" on the form;
- Set to pass-thru HTML
- Test and finish.
Step 1: Create a new Domino database Create a new, blank Lotus Domino database, giving it whatever name you want.
In the database properties, turn off "Web access: Use JavaScript when generating pages".
Step 2: Create the form Create a new form and name it "Demo".
In the form properties, make sure that "Treat document contents as HTML" is turned off.
At the very bottom of the form put the following line, which will prevent display of the submit button automatically generated by Domino. Ensure this remains as the final line at the end of the form throughout these instructions.
Step 3: Create the fields Now we'll create the fields. Field A (the Manufacturer field) contains a list of car Manufacturers. When the user changes the value of field A, the "onchange" event attached to Field A will trigger, and field B will then be updated with the names of car models available from that Manufacturer.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Advertisement --
Sophisticated Meets Simple For Document Management
Share. Control. Manage.
Documents, emails, and content in the context of how work is done.
Native to Lotus Domino. The User Experience unseen for Lotus Domino.
Do more with less. Really.
See the possibilities Docova unleashes for Lotus Domino. |
-- Advertisement --
Struggling with exporting Notes data to spreadsheets? No More!
Try IntelliPRINT, The world's leading Reporting, Dashboards, and Analysis solution for Notes & Domino
- Don't spend unproductive time maintaining different versions of the same spreadsheet
- Preserve data integrity and security in multi-user environments
- Create reports in minutes INSIDE Notes
- Get freedom from iterative report requests, deliver self-serve capabilities
Experience Reporting, Dashboards, and Analysis INSIDE Notes.
Try IntelliPRINT NOW! |
|
|
|
|
|
|
|
|
|
|