Search DominoPower's 11,974 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.
CATEGORIZED VIEWS
Advanced building of DHTML views with Internet Explorer
By Matt Holthe

In part one of this series (found at http://www.dominopower.com/issues/issue200008/dhtml0800001.html), I mentioned how one of the things I don't like about using categorized views from a browser is the fact that every time you expand or collapse a category, a request is made to the server. I noted that with the Java view applet, this round trip is eliminated, but there's an initial load time that must be accounted for. Plus, I have some customers who block external Java through their firewall, so the applet is no the solution for them.

Using DHTML, however, you can have a categorized view where the categories can be expanded and collapsed on the client, which solves both problems. In part one, we started looking at how this is done, starting with a view with only one category. Now, let's get more advanced. Let's say you have two categories.

Expanding the DHTML view
First, add a field called "Category2" to your form and modify the documents so they contain both categories. Change the Notes view and add a second categorized column between the two existing columns with a value of Category2.

OK, let's think about what we want the browser view to do. When a top-level category is clicked, the subcategories should be shown. And when a subcategory is selected, the documents should be shown. Furthermore, when a top-level category is collapsed, the subcategories should also be collapsed. (That's the way the Notes client works.)

Fortunately, @DocNumber gives us an indented value for subcategories. For example, "1.1" means the first subcategory under the first category. So, you would think that we would just duplicate the first column into the second column, changing "Category1" to "Category2." Well, that's actually pretty close. What actually happens if you do this is the subcategories start out with a </div> tag, so they actually close the <div> tag from the top-level category. This means that all categories are shown, whether they are top-level or not.

"Ok, just remove the </div> tag from the sub-level categories," you say. But that won't quite work either. The documents need to be grouped in their own <div>, and that grouping needs to be closed out. So the </div> is needed. What we want to do instead is to add an empty <div> tag to the end of the top-level categories. This will be closed by the first sub-category's </div> tag. But doing this means we'll be off on the number of <div> </div> pairs, so we have to add a </div> tag to the start of the top-level categories. And this means we want another empty <div> tag at the start of our view template to even out the </div> tags in the first category. Phew! So, now the first column has a value of:


1  ·  2  ·  3  ·  4  ·  5  ·  Next »
Other articles you might like
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
Lotus must open source Notes and Domino
It's time for Lotus to double-down on Linux and open source
Back to basics with Notes: what you can do now
Back to basics with Notes: what are the basics?
Back to basics with Notes
Smart Upgrade bug in Domino 8.5.1 (and some work-around tips)
Hands-on with XPages and the Lotus Solutions Catalog
Latest Lotus Headlines
IBM Lotus Notes 8.5.2: Upgrading your Icons from 16x16 to 32x32
IBM killed the Sandbox !
Followup on Cut and Paste problem in 8.5.2
Save us from our users: Doomsday Weekend 3
iNotes 8.5.2 Security Change With XSS
Warning about multiple Traveler installations in your domain
Admins: Modifying, Updating or Fixing your Config
>> Read all the news
More from the ZATZ journals
Computing Unplugged: Introducing the Jones family and their full-family backup challenges
David Gewirtz Online: CNN commentary and analysis
OutlookPower: Hands on debugging a broken Outlook forwarding rule
-- Advertisement --

Learn Notes and Domino 8 at your place and pace!
Learn Notes and Domino in your office and/or home! TLCC's highly acclaimed distance learning courses for users, developers, and admins will enhance your career and your resume.

The many included activities and demos will make you a pro! Expert instructor help is a click away.

Click here to try a FREE demo course!!

-- Advertisement --

Want the top Lotus experts by your side without paying hefty consulting fees?
Look no further.

Like having a team of consultants by your side -- ones who have all the answers and never make mistakes -- THE VIEW gives you immediate access to field-tested instruction, guidance, and best practices from the brightest Lotus professionals around.

See the new instruction, advice, and best practices added to THE VIEW this week.

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