Working with Buttons

Buttons are used to automate tasks and can be added to forms, subforms, pages, views, folders, navigators, layout regions, and layers. There are essentially two types of buttons that can be implemented in a Notes databaseaction buttons and hotspot buttons. Both functionally can perform the same task; however, they are distinguished by the location of the button within the application.

Action buttons are created and stored in the Action pane on the right side of the Designer client. By default, this type of button resides at the top of the design element and immediately below the Lotus Notes menu options. By default, the action buttons also appear under the Actions menu. This enables the buttons to be clicked from the graphical interface or selected from the menu bar. For example, many forms include Save and Close buttons to help with application usability.

Note

If the Action pane is not displayed in the Designer client, select the View > Action Pane menu items to have it displayed. Alternatively, you can drag open the frame using your mouse and left mouse button.

Hotspot buttons, on the other hand, are embedded within the design element and typically help the user to manipulate data or perform a task on the form or subform. For example, let's say you have a form that enables the user to attach three separate filesan Offer Letter, Acceptance Letter, and Resignation Letter (see Figure 4.26). Using buttons, users could locate and select the appropriate file and have it automatically attached in the correct field.

Figure 4.26. Example hotspot buttons

Finally, an embedded button can be displayed as a hotspot or as a button. From a functional perspective, they are equivalent. Visually, however, the graphic representation of a hotspot is slightly different from what most consider a button to look like. From an application development perspective, you'll probably find that most users prefer the traditional button to a hotspot.

Creating an Action Bar Button

Follow these instructions to create an action button for a form, subform, page, view, or folder.

1.

Open a form, subform, page, view, or folder and select Create > Action > Action from the menu bar. This will create an untitled action button and automatically display the property window.

 

2.

In the Action properties dialog, give the button a name and close the window.

 

3.

Next, select the client (either Notes or Web) where the button will run and a programming language.

 

4.

Finally, add the source code or use the simple action wizard to define the task that the button will perform.

 

Creating a Hotspot Button

Follow these instructions to embed a hotspot button in a form, subform, or page.

1.

Open a form, subform, or page and click on the area where you want the button to be placed. Then select Create > Hotspot > Button from the menu bar. This will create an untitled action button and automatically display the property window.

 

2.

In the properties dialog, give the button a label and close the window.

 

3.

Next, select the client (either Notes or Web) where the button will run and a programming language.

 

4.

Finally, add the source code or use the simple action wizard to define the task that the button will perform.

 

Creating an Action Hotspot

Follow these instructions to embed an action hotspot in a form, subform, or page.

1.

Open a form, subform, or page and select the text to be converted into a hotspot.

 

2.

Next, select Create > Hotspot > Action Hotspot from the menu bar. This will create an untitled action button and automatically display the property window. Unlike an action button, there is no label or name for this type of button, so you can close the property window.

 

3.

Next, select where the button will run and a programming language.

 

   

4.

Finally, add the source code or use the simple action wizard to define the task that the button will perform. After the hotspot is created, the user can click on the text area, and the action will be performed.

 

Commonly Implemented Buttons

Buttons can be created for just about any purpose. However, as a developer, you will come to find that some buttons are common to most Notes databases. The following are a few of the more commonly implemented action buttons.

Button

Formula

1. Save

@Command([FileSave])  

2. Close

@Command([FileCloseWindow])  

3. Edit

@Command([EditDocument])  

4. New Document

@Command([Compose]; "FormName")  

5. Attach File

@Command([EditGotoField]; "FieldName"); @Command([EditInsertFileAttachment])  

6. New Response

@Command([Compose]; "FormName")  

Note: Be sure to select "Response" or "Response to response" as the form type in the properties dialog.

7. Help

@Command([HelpUsingDatabase])  

8. Today

@Command([CalendarGoTo]; @Date(@Now))  

9. Open a database

Server:= "ServerName"; DBName := "NotesName"; @If (@Command([FileOpenDatabase]; Server : DBName; ""; ""; "1"); @Success; @Prompt([Ok]; "Warning."; "An error was encountered. Please contact the system administrator."))  

10. Forward document

@Command([MailForward])  

Note: Items in bold should be replaced with design element, field, database, or server name specific to your Notes database and environment.

Working with Views

Категории