Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Implementing a View Navigation Bar Across Frames

Florian Vogler (mailto:wbt@bat.at), Manager, Business Automation Team
Florian Vogler is the manager of development at BAT - Business Automation Team, a leading Lotus Business Partner in Austria. BAT is an Integrator that provides solutions within and around Domino and Notes: Custom Notes-, Intranet- and Internet-solutions, telephony services (phone, voicemail, fax, telex), Workflow, Document Management, and integration of various other systems (for example relational databases and SAP). Services include Consulting, Development and Training.

Summary:  This tip shows how to use JavaScript to access embedded invisible GIF files and make the default view navigation bar work in frames.

Date:  03 Aug 1998
Level:  Advanced

Activity:  2589 views
Comments:  

Have you ever wondered if there is an easy way to use the Notes default view navigation bar within frames? Now there is. This tip shows you how you can use JavaScript to access embedded in invisible GIF files, and make the default view navigation bar work in frames. The technique involves three forms. The first form defines the frameset. The second form contains the view navigation bar that you're already familiar with, except that this one will be hidden from users. The reason is that this navigation bar contains five invisible GIFs. Finally, the third form contains the navigation bar that users do see. It uses JavaScript to access the invisible GIFs in the hidden navigation bar. Your completed application would have the following layout:


Figure 1. Layout of your application in frames
Layout of your application in frames

Step 1. Create the frameset form

First, you need to create a form that defines your frameset using standard HTML. For example, we declared our frameset with the following code:

<HTML>
<!-- Lotus-Domino (Build v4.6.2_h - June 29, 1998 on Windows NT/Intel) -->
<HEAD>

<FRAMESET ROWS=100,*>
<FRAME SRC=http://web.notes.net/framed.nsf/documents/
htmlviewnav?OpenDocument NAME=HTMLViewNav>
<FRAME SRC=http://web.notes.net/framed.nsf/
documents?OpenView NAME=view>

</FRAMESET></HEAD>

<BODY TEXT="000000" BGCOLOR="ffffff">
</BODY>
</HTML>

Step 2. Create the form with the hidden navigation bar

Next, you need to create a form that contains the hidden navigation bar (frame 2 in the illustration above). To do this, you should create a view template form for displaying the content (documents) that make up your Web site. Then, create an embedded view on the form, which will contain the hidden navigation bar. The only difference between this navigation bar, and the one you would use for any other Domino Web application, is that this navigation bar is a series of invisible GIFs. Each GIF has a hotspot on it that contains the standard formulas you would use with a view navigation bar. For example, we used the following HTML for each of the five invisible GIFs, corresponding to the five standard links in a view navigation bar on the form:

<IMG BORDER=0 WIDTH=1 HEIGHT=1 SRC=/icons/ecblank.gif>

The invisible GIF ecblank.gif is located in the icons directory of your Domino server. We used this invisible GIF because we didn't want our users to see these GIFs. If we had used a hide when formula (the more common way of not displaying an image), Domino would not have published the information contained in each hotspot we created. If Domino didn't publish the information, then the JavaScript that we will show you how to create in Step 3, wouldn't work correctly. These GIFs allow us to publish the information, yet make sure it is invisible to the user.

We then selected each GIF and chose Create - Hotspot - Action Hotspot to apply an action-hotspot to it. We entered each of the following formulas one by one, for each action-hotspot:

@DbCommand("Domino"; "ViewPreviousPage")
@DbCommand("Domino"; "ViewNextPage")
@Command([ViewExpandAll])
@Command([ViewCollapseAll])
@Command([ViewShowSearchBar])

Step 3. Create the form with the "live" navigation bar

Finally, create the form that displays the "live" navigation bar (frame 1 in the illustartion above), with links that users actually access. This form uses JavaScript to:

  • Look up the link on the corresponding invisible GIF
  • Set the result as the new location for the view frame, thus changing the content in the frame

Domino automatically generates the correct links in our "live" navigation bar, because we linked the invisible images in the hidden navigation bar with Domino action-hotspots.

At the top of your form, create a field to declare the script language as JavaScript and declare a function call dovoid:

<script language=javascript>
function dovoid() {}
</script>

The "dovoid()" function ensures that the URL resulting from the former location change is not shown as text in the navigation frame, because dovoid returns no data to the frame (You could also use "void(0)", but this is not supported by all browsers).

Next, we use JavaScript code to "look up" the links in the hidden navigation bar. The order of the images/text-links in the JavaScript must be the same as the order of the formulas in the hidden navigation bar. For example, if the formula that asks Domino for the previous page is first, as it is above, the JavaScript below must have the previous page HREF listed first. The following JavaScript queries the GIFs in the hidden navigation bar and brings back the URL associated with the information in the view frame.

<A HREF="javascript:{parent.frames[1].location=parent.frames[1].
document.links[0].href;dovoid()}"><B>image/text previous page</B></A> 
<A HREF="javascript:{parent.frames[1].location=parent.frames[1].
document.links[1].href;dovoid()}"><B>image/text next page</B></A> 
<A HREF="javascript:{parent.frames[1].location=parent.frames[1].
document.links[2].href;dovoid()}"><B>image/text expand all</B></A>
<A HREF="javascript:{parent.frames[1].location=parent.frames[1].
document.links[3].href;dovoid()}"><B>image/text collapse all</B></A>
<A HREF="javascript:{parent.frames[1].location=parent.frames[1].
document.links[4].href;dovoid()}"><B>image/text search</B></A>

When a user clicks on Previous Page in the frame that has this JavaScript, the JavaScript accesses the information contained in the formula of the invisible GIF, and knows to switch to the previous page the user viewed. More specifically, the JavaScript automatically assigns a number to each frame. It looks at the parent frame, which is the whole frameset, and finds frame[1], which in this case is the view frame. It sets the location of this frame equal to the href property of links[0]. Link[0] is the first link in the invisible GIFs, and it's href property is a URL that Domino dynamically creates. This means that Domino executes the formula in the invisible GIF, and what the URL of the current page is and can therefore change the content of the frame to the previous page.


About the author

Florian Vogler is the manager of development at BAT - Business Automation Team, a leading Lotus Business Partner in Austria. BAT is an Integrator that provides solutions within and around Domino and Notes: Custom Notes-, Intranet- and Internet-solutions, telephony services (phone, voicemail, fax, telex), Workflow, Document Management, and integration of various other systems (for example relational databases and SAP). Services include Consulting, Development and Training.

Report abuse help

Report abuse

Thank you. This entry has been flagged for moderator attention.


Report abuse help

Report abuse

Report abuse submission failed. Please try again later.


developerWorks: Sign in


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

Choose your display name

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


Rate this article

Comments

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Lotus
ArticleID=12825
ArticleTitle=Implementing a View Navigation Bar Across Frames
publish-date=08031998
author1-email=mailto:wbt@bat.at
author1-email-cc=

Table of contents

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

For articles in technology zones (such as Java technology, Linux, Open source, XML), Popular tags shows the top tags for all technology zones. For articles in product zones (such as Info Mgmt, Rational, WebSphere), Popular tags shows the top tags for just that product zone.

For articles in technology zones (such as Java technology, Linux, Open source, XML), My tags shows your tags for all technology zones. For articles in product zones (such as Info Mgmt, Rational, WebSphere), My tags shows your tags for just that product zone.

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Special offers