Working with Views
Views are used to organize and display a collection of
There are two
Let's say, for instance, that you have a database with multiple forms. Using views, you could create a separate view for each form. To ensure that each view only displays the related documents, a unique selection formula is specified for each view. In this case, the selection criteria for one of the views would look something like
SELECT Form = "Reservation";
where "Reservation" is one of the forms in the database.
Use a selection formula or simple action to refine the information displayed in the view. If no formula is specified, all documents will be returned for the view.
In addition to selecting the content for a view, Designer allows you to specify the sort order, column content, and display appearance. Again, using the properties dialog, you can define a
From an appearance perspective, there are two types of displays
The Standard Outline view displays information in rows and columns. A Calendar view, on the other hand, changes the
For example, Figure 4.27 illustrates three different Standard Outline views. Each view contains the same information, simply sorted differently. The views could also be modified to include or exclude fields by changing what's displayed in the columns. In the first example, all of the documents are sorted by First
Figure 4.27. Example view sorted by Name
In Figure 4.28, all of the documents are sorted by the Record Number. In many applications, a unique document number is assigned to each record in the database. This view
Figure 4.28. Example view sorted by Record Number
In Figure 4.29, information is grouped based on a particular fieldthe document Status. This is called a "categorized" view. In this view, all documents that have the same status are grouped together and displayed under the green trianglecalled a twistie, as mentioned earlier.
Figure 4.29. Example view categorized by Status
The small green triangle, located to the left of each of the three status values (refer to Figure 4.29), is called a twistie . The twistie can be displayed or hidden by setting a checkbox in the view properties dialog.
Finally, Figure 4.30 depicts a Calendar view. To display documents on a Calendar view, the document must contain a date and duration, and the first two columns in the view must contain the start date and duration in minutes (which can be zero). See Chapter 8, "Calendar Applications," for detailed instructions for building a calendar application.
Figure 4.30. Sample Calendar view
Designer allows you to sort multiple data columns in a view. Columns are sorted from left to right in the view with the data being displayed in either ascending or descending order.
Views are typically used to display information to the users. However, views can also be used to manage the application. In many cases, programming-related views are hidden from the end-user to simplify the overall navigation of the Notes database. In many cases, hidden views are used to provide values for keyword fields or for calculations.
For example, let's say you want to assign a unique, sequential tracking number for each new document added to the database. Any time a user creates a new document, Lotus Notes
This could be achieved by using a view that contains one column, "Tracking Number," sorted in descending order. As new documents are created, the application retrieves the first record in the view (e.g., the top-most number) and increments the number. As soon as the document is saved, the new document becomes the top-most record in the view. Functionally, the view could be displayed or hidden. However, because users probably will find little benefit from a view that only contains
Hidden views can be displayed in the application by holding down both the Control and Shift keys while opening (or double-clicking on) the database icon. If navigators or outlines are used, then select the View > Go to menu options to display the view.
To hide a view, add the
Creating a Standard Outline View
Follow these instructions to create a standard outline view.
Creating a Calendar View
Follow these instructions to create a calendar view.
The calendar view will not display if the first and second columns do not respectively contain a date/time and duration value.
Mastering XPages: A Step-by-Step Guide to XPages Application Development and the XSP Language
XPages Extension Library: A Step-by-Step Guide to the Next Generation of XPages Components
Survival Guide for Lotus Notes and Domino Administrators
IBM Lotus Domino: Classic Web Application Development Techniques