Search DominoPower's 11,437 Lotus-related article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
Twitter Feed Click here for the Twitter feed.
Implementing dynamic drop-down menus using Domino and Internet Explorer (continued)

Step 7: Create the field that will hold the JavaScript keyword array and place it within the <script> tags

In this step we'll go back to the form and add a field named "tmpJavaScriptarray". Add this field just underneath the line <script language="JavaScript"> which was added in step 4.

The WebQueryOpen agent for this form inserts the view contents formatted as a JavaScript array into this field.

The field type should be "text" and "computed for display".

The field name should be "tmpJavaScriptarray".

In the field default value, type tmpJavaScriptarray, setting the value of the field to itself.

The results of this step should appear as in Figure F.

FIGURE F

The results should look like this.

Step 8: Create an "onload" event in the HTML header
When the HTML page is first loaded by the Web browser, we need the JavaScript UpdateModel() function to execute, filling field B (the Model field) with the appropriate values corresponding to the current value of field A (the Manufacturer field).

The way to do this is to go to the form and add the following code the to "HTML Head Content" form property:

"<body onload=\"UpdateModel();\" >"

This is shown in Figure G.

FIGURE G


Add the code to the form property. Roll over picture for a larger image.

Step 9: Add the agent to the "WebQueryOpen" on the form
When the HTML page is first loaded by the Web browser, we need the agent created in step 6 to execute.

The way to do this is to go to the form and add the following code the to "WebQueryOpen" form property:

@Command([ToolsRunMacro]; "WebQueryOpenAgent for demo form")

This is shown in Figure H.

FIGURE H


Add the code to the form property. Roll over picture for a larger image.

Step 10: Set to pass-thru HTML
On the form, hit control-A or from the edit menu and choose "select all".

From the "Text" menu, ensure the "Pass-thru HTML" is ON for the entire contents of the form.

Save the form.

Step 11: Test & finish
Whew! What a step-by-step marathon. I hope you hung in with me.

As I mentioned earlier, the individual steps are all easy to understand and easy to implement, but there's quite a few of them.

At last it should all be together and working. Try it out by typing the following into a Web browser:

http://xxx.xxx.xxx.xxxx/databasename.nsf/demo?openform

It should appear as in Figure I.

FIGURE I


This is what you should see. Roll over picture for a larger image.

Change the value in the Manufacturer field, and the values of the Model field should update to show the models available for that Manufacturer. Woo hoo!

Where to from here?
Dynamic drop down menus are extensively applicable in many Web applications.

Using this technique is great for navigating through lists of employees via workgroup. If you'd like to see it in action, I've made extensive use of this in my TaskMaster application that you can access live on the Internet at http://www.touchdown.com.au/trytaskmaster.html.


« Previous  ·  1  ·  2  ·  3  ·  4  ·  5  ·  6  ·  7  ·  Next »
Other articles you might like
Home > Internet Technologies > JavaScript (13 articles)
   Sorting your Domino views with JavaScript
   Give your Domino views life with DHTML
   Using dynamically generated HTML to thwart spam email address harvesting
Home > Internet Technologies > HTML and CSS (15 articles)
   Using a reusable code approach to HTML select option lists
   One reader's opinion on HTML mailing
   Keep lookin' good with Cascading Style Sheets
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Recent DominoPower Articles
Application development, William Shatner, and the origin of the universe
Learn Domino Designer 8.5 for free
The (near) future of Sametime, Quickr, Connections, and Symphony
Inside the IBM Innovations lab
Lotusphere 2010: Hot fixes and cool news for Notes, Domino, and LotusLive
Lotusphere 2010: mobility and collaboration
2010: A Lotusphere of change
Latest Lotus Headlines
SNTT : XPages onclick Ghosts in the machine
Ports used by Lotus Sametime 8.5 servers
Exploring a Domino Date Bug
Adding Quick Highlighter support to IBM Lotus Notes Domino Wiki, Weblog, or Webpage
Remember Young Admins...there are 2 files
WebSphere Portal 6.1.0.2 and Lotus Domino 8.5
The CKEditor - with Domino
>> Read all the news
More from the ZATZ journals
Computing Unplugged: The iPad defenders have spoken
David Gewirtz Online: CNN commentary and analysis
OutlookPower: More about disappearing text
-- Advertisement --

Find unused Lotus Notes groups and clean up your address book
Have you ever wanted to get rid of old Lotus Notes groups that were cluttering up your address book, but you weren't sure if they were used? Find Unused Groups can help.

Find Unused Groups will check your ACL, mail, multi purpose and server groups to help you determine if they are used, and who uses them.

Learn how to easily clean up your address book.

-- Advertisement --

Mark your calendar for in-depth Lotus training, May 12-14, Boston
Join experts and peers May 12-14 in Boston for educational and networking events that deliver real-world Lotus training so you can increase productivity and efficiency in your company, advance your skills, and squeeze the most from your current environment. One registration gets you into THE VIEW's Admin2010 and Lotus Developer2010.

Register by April 10 to save $200.
ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login