Search DominoPower's 11,441 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)

Column 2 in the view will be almost the same as the Notes view except that we have to generate all the HTML. Domino does nothing for us. So, let's put in a few spaces for indenting with "   " and then the value from the Subject field and a
to move to the next line. Therefore, the column formula looks like this: "   " + Subject + "
". In my example, I didn't allow for opening the document. To do this, you would put an <a href> tag around the contents of Subject. I omitted it here to keep things simpler.

Now, let's think about what we want for column 1. We want it to be categorized, but we want some HTML around the actual text. First, we want to show the twisty (remember, Domino won't generate it for us since we said the contents are HTML). Since everything will be "collapsed" (according to the end user) when the view is opened, we want the twisty pointing to the right, which is the file EXPAND.GIF in the server's /icons/ subdirectory. So, we have "<img src=/icons/expand.gif>" + Category1.

However, this isn't nearly enough. We need for that twisty to be clickable. Normally, you'd just add an <a href> around the image, but I'm going to let you in on a neat Internet Explorer secret. In Internet Explorer 4 or 5, you can capture a click event on the actual page and then, after the click event, figure out what you clicked on. This means we can build the page without the href's and instead just capture the click.

We'll get to that in a bit, but first you want to be able to tell your users that something can be clicked. I'll show you another neat trick. We can add a style to the image tag that tells the browser to change the cursor when you move over the image. It makes sense to use the "click here" cursor, which is called "hand." So, change the first column to be:

"<img src=/icons/expand.gif style=\"cursor:hand\">" + Category1. The \"

Characters are needed because we want to literally include quotes in the output string.

However, we're not done with the first column yet. We're going to need to know that this exact twisty was the one clicked. To do that, we need a unique identifier for the twisty. Using @DocNumber, we can get a unique identifier. So, the first column becomes:

"<img src=/icons/expand.gif id=Cat" + @Text(@DocNumber) + " style=\"cursor:hand\">" + Category1

I chose to put the letters "Cat" in front of the category number because it isn't good practice to start identifiers with numbers.

We're getting close
When the twisty is clicked, we need to know that one of our images was clicked instead of another image or an <a href> link. An easy way to do this is to apply a class to all the twisty images. The class will be the same for all images. Then, when something is clicked, we can check to see if what was clicked is in that special class. So, add this:


« Previous  ·  1  ·  2  ·  3  ·  4  ·  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 > 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
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
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: The iPad defenders have spoken
David Gewirtz Online: CNN commentary and analysis
OutlookPower: More about disappearing text
-- 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 --

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