Describes how to create a new Notes form with an embedded view.
In the previous task, you created a local IBM Lotus Notes database using the discussion template. You also created documents in that database to be later used to demonstrate inter-component communication in a composite application via the property broker function.
In this task, you enhance your Notes discussion database with a new Notes form that has an embedded view. This form will later be used as the lower component in the composite application described in the overview. When used as a component and wired appropriately, this Notes form will have a causal relationship with the upper component and will list, in its embedded view, documents matching the value published, in reaction to user activity, by the upper component.
Use the following procedure to create a new Notes form for use as a component in your two component composite application.
- Open MyDiscussion.nsf in your Lotus Notes client.
- Select any row in the displayed view.
- Start IBM Lotus Domino Designer by clicking View > Design. Domino Designer opens and displays the list of forms in MyDiscussion.nsf.
- In Domino Designer, click Create > Design > Form to create a new form in MyDiscussion.nsf.
- In the dialogue box that appears, name the form "DocByCategoryForm".
- At the top of the form, add the static text "Display documents in category".
- Click File > Save to save the form. To the right of the static text, add a field to the form by clicking Create > Field. Type "CategorytoDisplay" in the Name field and set the Type field properties to Text and Editable.
- Click to the right of your CategorytoDisplay field and press Enter twice to move the cursor down the new form.
- Add an embedded view to the form by clicking Create > Embedded Element > View. When the dialog appears, click the By Category view name. Click OK.
- Click the newly added embedded view to select it and then click Show single category in the Objects list (at the bottom of the list). Type "CategorytoDisplay" in the programmer's pane.
Note: Do not put quotes around CategorytoDisplay. This is the field name you added to this Notes form earlier. When there is a value in the CategorytoDisplay field, the embedded view will list only those documents that have this same value in their Category field.
- Optional: Place your cursor to the right of the embedded view then press Enter to move the cursor down the form. Click Create > Field to add a text field named SaveOptions to your form as described in the following substeps:
- Use the field's Properties box to specify that it is a "Text" and "Computed" type field.
- Select the programmer's pane for the SaveOptions field and set the value to "0".
Note: Include the quotation marks around the zero character.
- Click SaveOptions in the work pane and double-click to open the properties box for the field.
- On the 6th tab (window shade graphic) of the Properties box. In the Hide paragraph from selection, click Notes R4.6 or later.
Note: Adding the SaveOptions field to your form will prevent users from saving new documents through this form. Lotus Notes will not prompt you to save changes when you close the composite application after inter-component communication updates the CategorytoDisplay field.
- Click File > Save to save the changes you have made in this new form.
Note: Because you will use the property broker and LotusScript later to populate the CategoryToDisplay field, you can close this form now.
- Preview the form in Lotus Notes by clicking Design > Preview in Notes while still in Domino Designer. The form appears in Lotus Notes.
- Type in a string that matches the category value in the documents you created in the first task, such as "Category1" or "Category2".
- Click View > Refresh to refresh the form's embedded view. The embedded view lists documents that contain the category value that matches the one you typed.
- Press the Escape key to close this new document without saving it.
- Close Domino Designer.
You now have a Notes form with an embedded view that you will use as one component in a two component composite application. You will enhance this form in a later task to support inter-component communication.
Tasks described in the simple composite application example
Creating a new discussion database and documents
Creating a WSDL file to support inter-component communication