Search DominoPower's 11,443 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.
Building DHTML views with Internet Explorer (continued)

First, we capture the event into the srcElement variable. This gives us an object that was clicked. Then, we see if this object is a member of the "Twisty" class. If not, the click happened somewhere else on the page and we ignore it here (if there was an href, that'll still happen). Assuming that we did click on a twisty, we get the ID of what was clicked ("Cat" + @Text(@DocNumber)). If you notice, the <div> tag that was hidden under this category follows the same naming convention except that "Top" is appended to the end. So, we get a handle to that <div> tag by building its name and then going to the block through Internet Explorer's document.all syntax.

After we have a handle to the <div> tag, we check to see if that <div> tag is hidden or if it's being shown. If it's hidden (style.display == "none") then we want to show it. To show it, clear its display value. Then we want to change the image from a twisty pointing to the right to one pointing down (collapse.gif). This mimics the Notes functionality. To do this, change the source of the image. Of course, first make sure it's actually an image, which it better be.

Otherwise, if the <div> tag is being shown, we want to hide the <div> tag and change the twisty to the one pointing to the right (expand.gif). This is just the opposite of the code used to show the block.

That JavaScript should go into the JSHeader section in your R5 client. The only other thing we need now is to capture clicks on the page. To do this, simply add a line of JavaScript after the function: document.onclick = doOutline.

This tells the browser that whenever the mouse is clicked, run the "doOutline" function (the function we just wrote). Note that this line of JavaScript is not in any function. We want that line to execute when the page loads.

That's it. Give it a try and see how it works. You should be able to expand and collapse all the categories you want (you can have multiple categories expanded at the same time, unlike the Domino default view functionality) without having to go back to the server.

That's probably enough information for you to wrap your arms around right now. In part two of this series, we'll get more advanced and add a second category. Stay tuned.

Bulk reprints
Bulk reprints of this article (in quantities of 100 or more) are available for a fee from Reprint Services, a ZATZ business partner. Contact them at reprints@zatz.com or by calling 1-800-217-7874.

Matt Holthe is the lead developer for Breaking Par, a company specializing in Domino development for small and mid-sized businesses. He's a Principal CLP application developer for Domino R4 and R5. He can be reached via email at mattholthe@breakingpar.com.


« Previous  ·  1  ·  2  ·  3  ·  4
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 > Tips & Techniques (102 articles)
   More about Domino log files
   Why your log.nsf might not be purging properly
   A faster way to repair corrupted server files
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
Syncing Notes with Android phones
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
Latest Lotus Headlines
Xpages not loading? JVM errors? - Solution
How to implement an iCalendar feed into your Notes calendar with XPages
DWA Hotfixes for Domino 8.5.1FP1 - A Gotcha
IBM Adds DB2 to Lotus Foundations SMB Package
SNTT : XPages onclick Ghosts in the machine
Ports used by Lotus Sametime 8.5 servers
Exploring a Domino Date Bug
>> Read all the news
More from the ZATZ journals
Computing Unplugged: Online safety for virtual learning
David Gewirtz Online: CNN commentary and analysis
OutlookPower: Seek and find: Strategies to locate filed-away emails fast
-- 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 --

Integrate your Notes Applications with Microsoft Office and Symphony
Integra for Notes Integrates Microsoft Office and/or IBM Lotus Symphony
Requires NO change to the design of the appliation or Installations of DLL's and EXE's
  • Integra is a ready to use solution, enhance static reports with Excel data analysis, pivot tables, macros
  • User friendly aproach, using a point and click access to features
  • Reports from any Lotus Notes databases
  • Runs reports through a Notes client, web browser and scheduled basis
  • Allows use of LotusScript for advanced data manipulation
  • Enables self service reporting capabilities to end-users


Learn more at www.integra4notes.com.
ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login