This tip will show you how to create a frame which has buttons that act on a form or page in another frame using formula language. This will allow you to have a set of buttons in the top frame which does not scroll and allow the form in the bottom frame to scroll.

Click here to see a demonstration of this tip!

To get more information on developing Domino 6 web applications check out TLCC's Developing Domino 6 Web Applications course.
Click here to get more information on this course.

IBM Employees - click on the following link to get information on ordering this course at the IBM Global Campus!
Click here to get more information on this course at the IBM Global Campus.



Calling Action Hotspots From Another Frame

One issue with Domino actions is that the user can scroll down and the actions will disappear from the user's view until they scroll back up to the top of the document. One way to prevent that is to create a frameset. The top frame will contain a set of buttons that performs actions on the document in the bottom frameset. This technique works great when using buttons that have JavaScript. However, any buttons with formula language will not work since the button will act on the page containing the button and not on the document in the bottom frame.

A solution which allows the use of formula language and buttons in another frame is to have the button in the top frame call a Action Hotspot in the document in the bottom frame. The button in the top frame will use JavaScript to call the click event of the Action Hotspot in the bottom frame. The procedure below will show you how to do this.


Procedure: Creating a button frame

  1. Create a page which contains the buttons that you want to appear at the top of the form. The page below has just one button, Refresh. We will program this button later in this procedure.



  2. Create a frameset which contains two frames, "Top" and "Bottom." Set the Top frameset to display the page you created in step 1.



  3. Set the properties for this frame as follows to turn off the scrollbars and to prevent the user from changing the size of this frame:



  4. On the form which will display in the bottom frame create a Action Hotspot. Type in some descriptive text (the user will not see this), highlight the text and then select Create | Action | Action Hotspot from the menu.



  5. Go to the HTML tab of the Action Hotspot properties. Give this Action Hotspot an ID.



  6. Program the Action Hotspot with the formula language. Make certain to use @commands which are supported in a browser (see Domino Designer Help.) The formula in the demo validates the state and partname fields and then sets a field, Show, to @true to show the price computation.



  7. Once the Action Hotspot has been created and tested it needs to be hidden from the user. Don't use the Domino Hide-When formulas since that will cause the Action Hotspot to not be rendered to the browser. We want the HTML code which causes the Action Hotspot to be created to be sent to the browser to use it from the button. To accomplish this surround the Action Hotspot with passthru HTML that uses the DIV element with the style set to not display. Make sure to not set the Action Hotspot to passthru HTML. Only mark the starting DIV and ending DIV tags as passthru HTML.



  8. Edit the page created in step 1 which contains the buttons. Add the following JavaScript code to the button. The first line sets an object, orderDoc, equal to the document in the Bottom frame which contains the form. The second line refers to the HTML element called "Refresh" (the Action Hotspot's ID we created) and simulates the user clicking on this HTML element.



  9. Test your code by previewing the frameset in a web browser. Clicking the button in the top frame should cause the Action Hotspot to be called the same as if the user had clicked on the Hotspot themselves. The default target frame will be the bottom frame.