Working with Hotspots

A number of different types of hotspots are available from the Create, Hotspot menu prompt. You can create links, buttons, pop-ups, and action hotspots. These can be placed directly on the form wherever the design requires them. These can be quite useful, but be careful not to overdo it and wind up with a cluttered form. Table 5.7 lists the various types of hotspots. In all cases, except for a button, the text or object that you want to make into a hotspot must be selected first. Hotspots and buttons can also be added to Notes documents and pages. When you add or select a hotspot, the Hotspot menu appears with two prompts: Hotspot Properties and Remove Hotspot.

Table 5.7. Links, Buttons, and Hotspots

Hotspots Behavior
Link hotspot Links to other Notes documents, pages, views, databases, URLs, and so on.
Text pop-up Displays a text box with a drop shadow containing the text entered.
Button Performs programmed action when clicked.
Formula pop-up Displays a text box with a drop shadow when clicked. The text in the box is result of the formula.
Action hotspot Performs a programmed action when clicked.

Working with Links

A link hotspot can be created in two ways. First, you can create a link to another Domino object and return to the form, select the hotspot object, and then paste the link onto the object. To create a link, you can select the Domino object and choose Edit, Copy as Link, Link Type from the menu. This copies a link to the object onto the Clipboard. You can copy links to Domino Design objects from the Design Work pane without opening the object; simply select the object in the Work pane and choose Edit, Copy as Link, Named Element. You can also copy anchor, document, view, and database links to the Clipboard. There are two ways to paste links onto an object. After selecting the text or object on the form, you can press Ctrl+V to paste the link. You can also choose Create, Hotspot, Link Hotspot and, from the properties box that opens, click the Paste button.

In the second way to create a link hotspot, you can select the object and choose Create, Hotspot, Link Hotspot from the menu without a link copied to the Clipboard. From the Hotspot Resource Link properties box, you can create a link. Three types of links are available: a link, a named element, and a URL (the default). You've already seen how to work with a link. URLs can be typed into the Value field or copied to the Clipboard from a browser and pasted into the Value field with the Paste button. Perhaps the most powerful link is the named element link (see Figure 5.32).

Figure 5.32. The Hotspot Resource Link properties box is opened to the Hotspot Info tab with Named Element selected as the type.

graphics/05fig32.jpg

When set to Named Element, all three buttons are available. Table 5.8 lists the buttons and their functions.

Table 5.8. Hotspot Resource Link Buttons

Button Name Function
graphics/browse.gif Browse Browses a listing of the named design elements. Available only for the named element type.
graphics/formula.gif Formula Opens the Formula window. Available for named elements and URLs.
graphics/paste.gif Paste Pastes objects stored on the Clipboard. Available for all types except links.

The following named elements are available from the drop-down list:

  • Page (the default)
  • Form
  • Frameset
  • View
  • Folder
  • Navigator

To choose a named element, first select Named Element as the type and then click the Browse button. You can also select the type of named element from the New drop-down list that appears next to the Type field, and then enter a formula or the name of the element directly in the Value field. To enter a formula, click the Formula button. When you click the Browse button, the Locate Object dialog box opens (see Figure 5.33).

Figure 5.33. The Locate Object dialog box lets you choose from the named element type, the database, and the actual element.

graphics/05fig33.jpg

When you've created the link, you can specify a target frame for the link. When you do so, the link launches into the specified frame in its frameset. (For more information about framesets, see Chapter 10, "Adding Framesets to Domino Applications.") The last element on the Hotspot Info tab is Show Border Around Hotspot. When Show Border is checked, a thin green rectangular border appears around the text or object. If text is used for the hotspot, the text color is changed to blue, the standard color for hotspot text on the Web.

A number of tabs are available in the Hotspot Resource Link properties box in addition to the Hotspot Info tab already covered: Font, Paragraph Alignment, Paragraph Margins, Paragraph Hide When, Paragraph Styles, and Hotspot Extra HTML. Each of these tabs functions as it does elsewhere in Domino Designer.

Creating Buttons

Similar to actions and action hotspots, buttons allow the use of formulas, simple actions, LotusScript, JavaScript, and Common JavaScript. Buttons can be programmed for Web and Notes clients . To create a button, you can choose Create, Hotspot, Button from the menu, or click the Create Hotspot Button SmartIcon (see Figure 5.34). Buttons can be labeled or left blank and are programmed in the Script area. When a button is added, instead of the Hotspot menu, a Button menu is added with two prompts: Button Properties and Edit Button. Buttons can also be added to documents and pages.

Figure 5.34. A button hotspot has a typical pushbutton appearance that defaults to the system color.

graphics/05fig34.jpg

The Button Info tab shown in Figure 5.34 contains sections for Label, Width, Style, and Type. The Label section contains the button label and a check box to allow text to wrap. You can also specify the width of the button, which defaults to 2 inches. A drop-down list offers these options: Maximum Width, Minimum Width, Fixed Width, Fit Content, and Fixed (Chars). In the Style section, you can choose the background color and choose from one of three types of buttons: System, Square, or Rounded. The Type section is new to Designer 6, and you can set it to Normal, OK, Cancel, or Help. The Type setting is used when you create a form for use with a dialog box. The Type option is new in Designer 6 and is not compatible with the R5 designer. The OK and Cancel options function as you would expect in the dialog box without any programming on your part. Help works only on the Macintosh. If you click the Default check box for a button, it is selected at runtime as the default.

The properties box has other tabs: Font, Paragraph Alignment, Paragraph Margins, Paragraph Hide When, Paragraph Styles, and Button Extra HTML. Again, these are the same tabs that you see in a Text properties box. Remember, as with the Text properties box, the Hide When settings apply to the entire paragraph, not just to the button.

Buttons are usually created when you need to perform some function that is very specific to a location on a form. For example, you might have a lengthy form and two entries for a patient's weight: one for weight in pounds and the other for weight in kilograms. A button to convert one to the other would not make that much sense in the Action bar, but would make sense on the form itself next to the weight fields. After creating the button, add a formula to convert from pounds to kilos or vice versa.

TIP

Adding functionality that relates to information at a specific location in a document is a perfect situation for using a table. Placing the button and fields in the same row but in different cells allows you to turn off printing for the cell containing the button. Obviously, there isn't much need for the button to appear in print, but you do want the data to appear.

 

Using Pop-Ups to Inform Users

Two kinds of pop-ups exist: text pop-ups and formula pop-ups. The text displayed by text pop-ups is entered into the Popup Text field in the Hotspot Pop-up properties box. You can control how and when the text is displayed through choices you make in the Hotspot Pop-up Info tab (see Figure 5.35). You can set the display to Show Pop-up on Mouse Over, which is the default, or Show Pop-up on Click. The Hotspot style can be set to Border the Text, Highlight the Text, or None. Selecting Border displays the familiar green border around the hotspot. When you choose Highlight, the text object displays with a yellow background similar to the highlight function available on word processors such as Microsoft Word and Lotus WordPro.

Figure 5.35. The Hotspot Pop-up Info tab is unchanged from R5.

graphics/05fig35.jpg

Pop-ups can also be created with a formula pop-up. To create a formula pop-up, select the object and choose Create, Hotspot, Formula Pop-up from the menu. The Script area opens and the formula to produce the text can be entered (see Figure 5.36). Only the Formula language can be used to program this type of pop-up. The display options for a formula pop-up are the same as those for a text pop-up.

Figure 5.36. A formula for the pop-up is written in the Script area.

graphics/05fig36.jpg

Pop-ups appear in a text box that has a simple border and a light off-white background (see Figure 5.37).

Figure 5.37. The text pop-up produced by the formula shown in Figure 5.36.

graphics/05fig37.jpg

Programming Action Hotspots

An action hotspot allows the use of formulas, simple actions, LotusScript, JavaScript, or Common JavaScript. You can attach an action hotspot to text or other objects on the form and program it just like you would a button. To create an action hotspot, select the hotspot area with the mouse and choose Create, Hotspot, Action Hotspot from the menu. The Action Hotspot properties box opens to the Hotspot Info tab. This tab is simple and consists of a field for a frame and a single check box for displaying a border (see Figure 5.38).

Figure 5.38. The Hotspot Info tab of the Action Hotspot properties box has few selections compared to the other hotspots.

graphics/05fig38.jpg

Part I. Introduction to Release 6

Whats New in Release 6?

The Release 6 Object Store

The Integrated Development Environment

Part II. Foundations of Application Design

Forms Design

Advanced Form Design

Designing Views

Using Shared Resources in Domino Applications

Using the Page Designer

Creating Outlines

Adding Framesets to Domino Applications

Automating Your Application with Agents

Part III. Programming Domino Applications

Using the Formula Language

Real-World Examples Using the Formula Language

Writing LotusScript for Domino Applications

Real-World LotusScript Examples

Writing JavaScript for Domino Applications

Real-World JavaScript Examples

Writing Java for Domino Applications

Real-World Java Examples

Enhancing Domino Applications for the Web

Part IV. Advanced Design Topics

Accessing Data with XML

Accessing Data with DECS and DCRs

Security and Domino Applications

Creating Workflow Applications

Analyzing Domino Applications

Part V. Appendices

Appendix A. HTML Reference

Appendix B. Domino URL Reference



Lotus Notes and Domino 6 Development
Lotus Notes and Domino 6 Development (2nd Edition)
ISBN: 0672325020
EAN: 2147483647
Year: 2005
Pages: 288

Flylib.com © 2008-2020.
If you may any questions please contact us: flylib@qtcs.net