Search DominoPower's 11,323 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.
JAVASCRIPT FOR FUN AND PROFIT
Using JavaScript to get the Query_String from a frameset
By Dan Velasco

At my company, we recently received an application a consulting company had created for us that had a fatal flaw. Well, maybe not a fatal flaw, but definitely one that would make developers want to slit their wrists because of all the maintenance and customization involved.

It was an e-commerce application designed to assist our customers in buying our products. The main page was a frameset with three frames: a top frame, a left-hand side frame, and a main body frame. The main body frame, by default, contained login information, and that was all, as you can see in Figure A. The challenge we faced was that we wanted to create custom home/login pages for each of the products showing a picture of the product along with a customized welcome message.

FIGURE A


The default screen only contains login information, challenging us to customize it for each of our products. Roll over picture for a larger image.

The fatal flaw in the application the consulting company had created for us was that in order to create custom home pages for each of our products, it required the following steps:

  1. Create a new frameset and then name it after the product;
  2. Create a custom home page Domino form for the product;
  3. Create a configuration document for each product that includes such information as the name of the product, its home page URL, and an attached file that contains a picture of the product, among other things.

In case you're keeping count, that's two Domino design elements that would have to be created for each product. Multiply this by an initial set of almost 30 products and you get the picture of how unwieldy this could quickly become. As you are no doubt thinking, the method above does not require a lot of skills but it does require that the person who is creating these custom home page framesets and forms have a Notes Designer client. Gee, whom would they come to with change requests?

This solution was simply unacceptable to me, and I knew there had to be a better way. Well, there is, and all it involves is a basic understanding of JavaScript, Query_Strings, and the code I am about to give you. The solution outlined in this article is designed to work in Notes/Domino R5 only. For a sample database containing the complete code described in this article, please go to http://dan.velasco.com.

How do you get the Query_String of a frameset?
OK, here's a quick refresher. The Query_String is the part of the URL that usually starts with either the question mark or exclamation mark, as the case might be. For instance, in the URL http://sample/db.nsf/MainFrameset?OpenFrameset&;fname=Dan&lname=Velasco, the Query_String would be "?OpenFrameset&fname=Dan&lname=Velasco". There are two parameters, one called fname with a value of "Dan" and one called lname with a value called "Velasco." When you are not using framesets, it is fairly easy to get and manipulate the Query_String using a computed for display field on the form set to Query_String or by getting doc.Query_String(0) via LotusScript. When the form is in a frameset, however, you've got to take a different approach.


1  ·  2  ·  3  ·  4  ·  5  ·  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
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
Lotusphere 2010: mobility and collaboration
2010: A Lotusphere of change
Five trends for 2010
DominoPower TV Episode 1: Inside a strategy session with Teamstudio
More about Domino log files
Say goodbye to the Uh-Ohs. Long live the Tens.
Why your log.nsf might not be purging properly
Latest Lotus Headlines
Recommended Maintenance - Lotus Notes Traveler
Here are the slides and other materials from our Lotusphere session
Microsoft OCS awareness in Lotus Connections and Websphere Portal?
SnTT: XPages Blank Calendar Control (Part 2), adding data
Have your Lotus Notes calendar display multiple time zones
Sample Database for Microsoft Office and Lotus Symphony Integration
Symphony 3.0 beta signals another attack on Office
>> Read all the news
More from the ZATZ journals
Computing Unplugged: The iPad: Apple's latest heartbreaker
David Gewirtz Online: CNN commentary and analysis
OutlookPower: Running auto-respond rules when Outlook is closed
-- Advertisement --

Power Tools 6.0 is a set of 90 administrative utilities for Lotus Notes & Domino
Power Tools simplifies management of the Notes/Domino environment by automating routine tasks. Power Tools can manage or monitor mail files, groups, ACLs, agents, LOG.NSF, templates and more.

Download a trial version from helpsoft.com.
-- 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 December 31 to save $350.
ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login