You can add a number of embedded elements to a form by choosing Create, Embedded Element, Element. Many of these are the same elements that can be embedded on a page; many times, a page is a better choice for an embedded element than a form. You can embed the following elements on a form:
All but the editor, scheduler, and file upload control can be added to a page; these are covered in Chapter 8.
Using Embedded Editors
Embedded editors are new to Designer 6, and they can be created for forms but not for pages. You can include forms within a form using an embedded editor, and you can link them to embedded views. You add embedded editors to a form by choosing Create, Embedded Element, Editor from the menu (see Figure 5.49). You can choose a form from the current database or another database, or you can use a formula to specify a form. When you select None in the dialog box, you can later paste a link to a document or anchor link into the editor.
Figure 5.49. The first selection in the Insert Embedded Form dialog box is None.
When you embed a specific form, it appears in a preview window on the form. If you choose None or click Choose a Form Based on a Formula, a rectangular preview pane appears on the form (see Figure 5.50).
Figure 5.50. A blank preview area appears if a specific form is not selected. The Embedded Editor properties box is open to the Info tab.
To open the properties box, right-click the preview area and then choose Editor Properties from the context menu (see Figure 5.51). The properties box opens to the Info tab. The Info tab of the Embedded Editor properties box has three sections: Name, Size and Content. Name is optional, unless you're working with a linked view. The size of the preview area is initially the same, even if a form is selected in the Insert Editor dialog window. To resize it, you can enter a new width and height, or you can click Fit to Window for width and height. The remaining tabs, Border, Paragraph Alignment, Paragraph Margins, and Paragraph Hide When, have all been covered already.
Figure 5.51. The Embedded Editor properties box displays Named Element in the Type field when a specific form is selected.
To use an embedded editor with a view, you need to name the editor and also embed a view. Choose Create, Embedded Element, View from the menu. Once the view is embedded, enter the name of the embedded editor in Target Frame for Single Click on the Info tab of the Embedded View properties box. See Figure 5.52.
Figure 5.52. This embedded editor is shown in design above an embedded view. The Embedded View properties box is visible on the left, with the Contacts Editor in the Target Frame field.
Test your new form and make any adjustments necessary. For example, Figure 5.52 has a border for each embedded element and has had the size adjusted for better display (see Figure 5.53).
Figure 5.53. The contents of the embedded Contact Information document appears above the embedded view, and changes as you move through the view.
Using a File Upload Control
A file upload control allows Web clients to attach files to a document. To create an upload control, choose Create, Embedded Element, File Upload Control from the menu. A gray rectangular button is inserted into the form at the cursor's location labeled File Upload (see Figure 5.54). The File Upload has a properties box, and the tabs are the standard Paragraph Alignment, Paragraph Margins, Paragraph Hide-When, Paragraph Styles, and Upload Extra HTML tabs. Of course, this design element is not needed for a Notes client, so you'll want to hide it from Notes and mobile clients by checking Hide Paragraph from Notes R4.6 or Later and Mobile on the Paragraph Hide-When tab. For the file upload control to work, your server administrator must have a temp directory specified on the Domino server.
Figure 5.54. The file upload control works only for Web clients.
Working with the Embedded Scheduler
The Embedded Scheduler can be embedded only in forms and subforms. More than one scheduler can be included. You cannot embed a scheduler on a page because the Embedded Scheduler requires at least three pieces of information from the underlying document: The first contains the members of the group , the second stores the start time for the grid, and the field stores the number of hours to display for each day.
Creating a form to contain a group scheduler can be fairly involved, depending upon your needs. You can look at the ( GroupCalendar ) form in the Notes and Domino 6 mail database for a good example. Here, I'll take a simple approach to give you an idea of what can be accomplished. First, add the Embedded Scheduler to your form by choosing Create, Embedded Element, Scheduler from the menu (see Figure 5.55).
Figure 5.55. The Group Scheduler has many new events added in Designer 6. The Required People item has the cMembers field added in quotes.
When the scheduler is embedded, look in the object list in the Programmer's pane, and you'll notice a number of events. At a minimum, you must program Required People Items, Grid Start Time Item, and Display Hours Per Day Item. All three events need to have the name of the corresponding field from your form entered in the Script area. Use quotes to surround the field names , as in Figure 5.55.
The Group Scheduler properties box has several tabs: Info, Font, Colors, Border, Layout, Paragraph Margins, and Paragraph Hide When. The Border Tab, Paragraph Margins, and Paragraph Hide When tabs are the same tabs you've already seen for other objects, and they aren't covered in this section. The Info tab shown in Figure 5.55 has settings for Name, Target Frame, and Display Options Content Options, as well as four Title fields at the bottom.
The Font tab has options for three different areas: Left Header Font, Left Font, and Right Header Font, as shown in Figure 5.56. You can make all fonts the same by clicking the Set All to Same button.
Figure 5.56. The Font tab has settings for different types of text.
The Colors tab (see Figure 5.57) contains numerous settings for the colors of the calendar control itself (foreground and background) and settings for Gridlines, Unavailable, Already Scheduled, Available, and Info Restricted. These colors can be seen in the legend also.
Figure 5.57. The Colors tab has many different settings for different areas of the calendar control.
The Layout tab (see Figure 5.58) has settings for width and height. There are two width and three height settings. Overall Width can be expressed in Fit to Window (%) or as a fixed width in inches. Left Width can be set to Fit to Scheduler and Fixed. The three Height settings, Top, Middle, and Bottom, can be set to Fixed Height (Lines), Fit to Content, or None.
Figure 5.58. The Designer 6 Layout tab has expanded options to size the control.
TIP
To keep the edge of the scheduler from going too far to the right, set the Overall Width option to Fit to Window (%) and set it to something less than 100%.
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