rhs blog
Richard Schwartz's Web Log
Powered by Lotus Notes & Domino 6



rhs blog is being phased out

Please visit The Power of The Schwartz


penumbra logo Penumbra Bloggers
Dan Fredricksen (rss)
Melissa Gena (rss)
Carolyn Kraut (rss)
Ben Langhinrichs (rss)
Henry Newberry (rss)
Rob Novak (rss)
Rocky Oliver (rss)
Andrew Pollack (rss)

notes logo Domino Bloggers
3C Interop (rss)
Airplay (rss)
Gaston Annebicque (rss)
Andrew Barker (rss)
Robert Basic (rss)
Chris Bekas (rss)
Alan Bell (rss)
Brian Benz (rss)
Ray Bilyk (rss)
Olaf Björklund (rss)
David Bockes (rss)
Michael Braly (rss)
Chris Brandlehner (rss)
Breaking Par (rss)
Ed Brill (rss)
Bill Buchan
Sean Burgess (rss)
Christoper Byrne (rss)
Curt Carlson (rss)
Rune Carlson
Colman Carpenter (rss)
Jerry Carter (rss)
Steve Castledine (rss)
Ferdy Christant (rss)
Chris Coates (rss)
CodeStore (rss)
Patrick Corey (rss)
Jack Dausman (rss)
Ray Davies (rss)
Laurent deWalick (rss)
Dave Dickey (rss)
Almar Diehl (rss)
Frank Docherty (rss)
Domino-IT (rss)
Dragon
Thomas Duff (rss)
Bruce Elgort (rss)
Warren Elsmore (rss)
Ed Falcon
Jens-Christian Fischer (rss)
Wolfgang Flamme (rss)
Dan Fredricksen (rss)
Nathan Freeman (rss)
From Domino (rss)
Melissa Gena (rss)
Nick Goddard (rss)
Mike Golding (rss)
Neil Gower (rss)
Mac Guidera (rss)
David Gurteen
Mike Hamner (rss)
Christopher Harvey (rss)
John Hawkins (rss)
John Head (rss)
Henning Heinz (rss)
Alex Hernandez
Anthony Hicks
Kurt Higley (rss)
Roy Holder (rss)
Jake Howlett
InsideLotus (rss)
Jochen Tinn (rss)
Jon Johnston (rss)
Johan Känngård (rss)
Tony Kelleran (rss)
Chris King (rss)
Justin Knol (rss)
Hynek Kobělka (rss)
Heinz Ulrich Krause (rss)
Carolyn Kraut (rss)
Francois Lafleur (rss)
Neill Laney (rss)
Ben Langhinrichs (rss)
Justin Lauder (rss)
Chris Linfoot (rss)
Joe Litton (rss)
LNDCentral (rss)
Martin Los (rss)
Gonzo Lotusphere (rss)
Declan Lynch (rss)
Eric Mack (rss)
Brian Mahoney (rss)
John Z. Marshall (rss)
Rob McDonagh (rss)
Kathleen McGivney (rss)
Ian McNairn (rss)
Dave Meehan (rss)
Chris Miller (rss)
Stephen Mitchell (rss)
Paul Mooney (rss)
Mike Munnis (rss)
Dave Navarre (rss)
Captain Nelson (rss)
Henry Newberry (rss)
News4Notes (rss)
Tom Nichols
Fabian Nirman
Keith Nolan (rss)
Tom O'Neil (rss)
Bob Obringer (rss)
Rocky Oliver (rss)
Tony Ollivier (rss)
Devin Olson (rss)
Nuno Pereira (rss)
Bruce Perry (rss)
Andrew Pollack (rss)
Ben Poole (rss)
Kevin Presseault (rss)
Colin Pretorius (rss)
Project DX (rss)
Jack Ratcliff (rss)
Niel Revelle (rss)
Julian Robichaux (rss)
Stan Rogers (rss)
John Roling (rss)
Ben Rose (rss)
Jeremy Schwab
Libby "NotesGirl" Schwarz (rss)
Nik Shenoy (rss)
Matt Smith (rss)
Michael Sobczak (rss)
Lance Spellman (rss)
Philip Storry (rss)
Jess Stratton (rss)
Keith Strickland (rss)
Chris Toohey
Carl Tyler (rss)
Erwin van Hunen (rss)
John Vaughan (rss)
Maurice Verhagen (rss)
Florian Vogler (rss)
Michael Wagner (rss)
Volker Weber (rss)
Websphere Portal Notebook (rss)
Paul Westlake (rss)
Matt White (rss)
Colin Williams (rss)
Stephan Wissel (rss)
Ed Wrenbeck
Rob Wunderlich (rss)

Other Bloggers
Jeremy Allaire (rss)
Dave Barry
Ned Batchelder (rss)
Matthew Berk (rss)
Hiawatha Bray
Dan Bricklin (rss)
Bob Congdon (rss)
Cool Tools (rss)
Mark Cuban (rss)
David Pogue (rss)
Howard Dean
Peter DeHaas (rss)
Gary Devendorf (rss)
Esther Dyson
Bruce Eckel (rss)
Miguel Estrada (rss)
Amitai Etzioni
Bob Frankston & David Reed (rss)
Adam Gaffin (rss)
Dan Gillmor (rss)
Steve Gillmor (rss)
Gary Hart
Charles Hudson (rss)
Chris Kagy (rss)
Mitch Kapor (rss)
Damien Katz (rss)
Lawrence Lessig (rss)
Pete Lyons (rss)
Many to Many (rss)
Joshua Marshall (rss)
Ross Mayfield (rss)
Measure Twice (rss)
Michael Moore
Peter O'Kelly (rss)
Ray Ozzie (rss)
Sebastian Paquet
John Patrick (rss)
Jonathan Peterson (rss)
Tom Peters (rss)
Mark Pilgrim (rss)
Glenn Reynolds
Steve Rubel (rss)
Sam Ruby (rss)
Pito Salas (rss)
Michael Sampson (rss)
Andrew Samwick (rss)
David Schatsky (rss)
Kevin Schofield (rss)
Jonathon Schwartz (rss)
Robert Scoble (rss)
Clay Shirky (rss)
Smart Mobs
SocialText Blog (rss)
Joel "on Software" Spolsky (rss)
Jon Udell (rss)
Venture Blog
Wil Wheaton (rss)
Andy Williams Affleck (rss)
Dave Winer
Amy Wohl
Tom Yager (rss)
Steve ?

notes logo Notes & Domino
Penumbra Group LDD OpenNTF
Lotus Software IBM FAQ

notes logo Domino Blogging
FreeDom Blog Dom Blog
BlogSphere DominoBlog

RHS On The Web
RHS Consulting Home Page
Links To This Page

On www.lotus.com...
 Lotusphere 2003 Preview

On www.advisor.com...
 Lotusphere 2002
    Reports 1 2 3
 Domino Designer 5
 The Notes C++ API
 .NET and Domino
 LotusScript Coaching
 Tips 'n Tricks

On LDD Today (www.notes.net)....
 Lotusphere 2003
    Reports 1 2 3 4
 Field Encryption
 Frames in 4.6
 Domino Architecture,
    Parts 1 and 2
 Bruce's Article on
    Objects

Overloading _DoClick

Here's a technique that I used in constructing the Bloggregator user interface. The upper left hand pane of the UI contains three combo boxes. The Category combo box causes a refresh in that particular pane, which reloads the choices in the Blog combo box. The Blog combo box and the Entries combo box each cause a refresh in the view pane to the right. As anyone who has done any programming with frames in Domino knows, getting something like this to happen without using a "Go" button is difficult because Domino generates special code for onChange event for the select object if you tell it to do the automatic refresh on keyword changes. You need that special code to execute, but you also want your own code to execute in order to update information in a second frame. I accomplish this by taking advantage of the fact that in JavaScript, functions are, in a way, schizophrenic.

A JavaScript function exists in two ways. It exists as code, and it exists as an object variable that contains the code. To do what I want, I insert JavaScript code that looks like this into my form:

<script language='javascript'>
var Domino_doClick = _doClick
function my_doClick(v,o,t,h)
{
  // calculate a URL here
  top.OtherFrame.location.href = url
  Domino_doClick(v,o,t,h)
}
_doClick = my_doClick
</script>

Domino generates a call to the _doClick function for the onChange event of a keyword field (and for many other events). I need that code to run, but I also need my own code to run. I need to intercept calls to _doClick, take an action, and then let those calls proceed.

What I'm doing is saving the _doClick function code that Domino generated in a new object called Domino_doClick. Then I create a new function called my_doClick, which uses the same four arguments as the one that Domino generated. The code in my function does whatever it needs to do, and then it calls the Domino_doClick object passing along all the arguments unchanged. Since the Domino_doClick object contains the same code as _doClick, this accomplishes my objective of allowing Domino's code to run. Once my function is defined, I assign its code to the object variable _doClick, and this accomplishes my objective of intercepting the events before the Domino-generated script gets a chance to execute.

Here's my actual code from Bloggregator:

<script language='javascript'>
var Domino_doClick = _doClick
function my_doClick(v,o,t,h)
{
  blog=document.forms[0].kwdBlog.options[document.forms[0].kwdBlog.selectedIndex].text
  entries=document.forms[0].kwdEntries.options[document.forms[0].kwdEntries.selectedIndex].value
  url='http://smokey.rhs.com/web/blog/gregate.nsf/1. Selected Articles/' + entries
  if (blog != "All")
  {
    url = url + '/' + blog
  }
  top.Folder.location.href = url
  Domino_doClick(v,o,t,h)
}
_doClick = my_doClick
</script>

In a nutshell, the code is determining whether the Folder frame is being loaded with a folder that includes entries from All blogs for the selected time frame (in the kwdEntries selection), or just the entries from a specific blog (in the kwdBlog selection). It constructs the appropriate URL, sets the href for the frame, and then calls Domino's original _doClick function to do the keyword refresh.

One bit of warning about this technique. Future releases of Domino could conceivably cause it to break by changing the number of arguments to the _doClick function. I believe that there are ways to safeguard against that -- or at least to detect it and throw an error -- and if I used this technique a little more often I'd probably bother to work it out, but as of now I just live with the knowledge that I have to check for changes in _doClick with every major release of Domino.




Discussion | Post Response

My Company An Association of Lotus Business Partners That I Helped Found
I contributed to this book
Previous MonthJan05
1234567
891011121314
15161718192021
22232425262728
293031

By Category
Blogs, Social Software & Collaboration
Business, Processes & Methods
Computer Industry News
Diversions
Events, Presentations & Awards
IBM, Lotus, Notes & Domino
Law and Technology
News, Politics, Issues, Opinion
Personal
Pet Peeves
Programming
Projects - Blog Aggregator
Projects - RSS Feed Generator
QuickBlogs
Spam & Security
Systems And Networking
Technology & Science
Tips - Programming
Travel & Food
Tributes


Recent Blog Responses
538: Debate
Ben L.: Crisis
NY Times: Friedman
Ed Brill: Congress
Osterman: Spammers
Kevin Schofield: SEC
NY Times: Bailout
Turtle: Hamster
Pito Salas: Cramer
Amy B.: Schvartzeh
Amy B.: Egghead
Chris Linfoot: Iceland

Really Useful Blog Entries
Volker Weber's: devWorks Live links
Mike Golding's CSS Buttons
Kalsey: Button Maker
McKnight: Steal These Buttons
Kalsey: CSS Tabs

Required Reading
Joel on Software - Strategy Letter V
Understanding Notes and Its Developers
Rise of the Stupid Network
Dijkstra: Programming as a Human Activity
Fred Brooks: No Silver Bullet
Ken Thompson: Trusting Trust
Paul Graham: Hackers and Painters
Paul Graham: Lots of Stuff About Spam
notestips.com :: Homepage Best Practises
Shirky: A Group Is Its Own Worst Enemy
Joel On Software: Stupidity
Intranet Journal: Content Owners & Developers
Chris Linfoot: Email Disclaimers
Jack Dausman: Server ID Security
Jim McCarthy: 21 Rules of Thumb

What's All This About Social Software?
Social Software Alliance Wiki
Guardian: Social climbers
Headshift: Smarter, Simpler Social
Many-to-Many: Social Software
Shirky: Politics of Groups
Smart Mobs: Historical Roots
Coates: Working Definition
Corante: Earliest Use of the Term
Corante: Why Social Software?
Corante: Why Now?
Shirky: IM Rulz
Stowe Boyd: -Are You Ready?
Many-to-Many: Communities and Networks

Noters & Domino 6 Bible Mentions
Volker Weber: What a fat book
Ray Davies: Comment
Joe Litton: Welcome Rocky!

Contact Info
email - Email
aim - AIM
home - Personal Home Page
home - RHS Consulting Home Page

Search
Javascript required for search

Legal
Attribution required. Permission required for commercial use.

Translation