Step by Step description how to build the sample
Make sure you have performed the initial steps to rebuild the samples before you proceed (see Preparations for Version 4.5 samples). Create a new visual part . If you have not already done so, create a connection specification named MyDiscussionSample for the local \vasample\vadis45.nsf database.
The Sample description is divided into two sections:
Creation of the view and its functions
Connection to the corresponding form
Creating the view
1. Select Domino Parts from the parts palette and add a Domino View part to the free form surface. Configure the view part to represent the ($All) view of the sample database using the MyDiscussionSample connection specification. If you are not sure how to do this, proceed according to the description Using a view part . Don't forget to connect the open and close events.
2. Create a Quickform from the viewTable attribute of the view part and place it in the main window. This automatically adds the tear off attribute viewTable to the free from surface. Delete the second and third column from the columnar list, because they contain programming information for Domino and should not be displayed to the user. Add four buttons to the main windows labeled: Delete, New, Update, and Close.
3. Add a Domino Form part to the free form surface. This part is used to delete documents from the database. As the view part does not provide a protocol to delete documents, you have to set the current document (that is the selected document in the views list) in the form part and delete it from there. Set up the form part to match the Main Topic form for the sample database. Tear off the database attribute from the view part and connect its self attribute with the database attribute of the form part. This step eliminates the need to explicitly open and close the from part. When you connect the Delete button, you have to make sure that the actions invoked by the clicked event are performed in the right order. First connect the clicked event of the Delete button with the editRow: action of the form part. This is done to select the document to be deleted. Supply the parameter for the editRow: action from the viewTable parts selectedRow attribute. Next connect the clicked event of the Delete button to the deleteNote action of the form part. This action eventually deletes the selected document from the database (if you have sufficient access rights). Finally connect the clicked event of the Delete button with the update action of the view part. That ensures that the deleted note is removed from the list in the main window.
4. Connect clicked event of the Update button to the view parts update action. Connect the clicked event of the Close button to the closeWidget action of the main window
Creating the corresponding form
1. To successfully rebuild the sample, you have to enhance the form part demo, which you have already built (Using a from part). Open the form part sample and promote the editNote: action of the form part. Name the promoted action MainTopicFormEditNote:. Also promote the newNote action of the form part. Name the promoted action MainTopicFormNewNote. Save the part and go back to the AbtNotesDemoViewAndForm45 sample.
2. From the Options menu of the Composition Editor, select the Add Part option and select the class AbtNotesDemoForm45. Select View wrapper as part type. Add the view wrapper to the free from surface.
3. Connect the NOTE_MainTopic event of the viewTable part to the openWidget action of the view wrapper to open the selected document in its own window. Connect the NOTE_MainTopic event of the viewTable part to the promoted action of the view wrapper named MainTopicFormEditNote: to select the particular document for display.
4. Connect the clicked event of the New button to the openWidget action of the view wrapper to open a form of a new document. Connect the clicked event of the New button to the promoted action of the view wrapper named MainTopicFormNewNote to actually create a new document in the database.
5. Connect the closedWidget event of the view wrapper to the update event of the view part to make sure the view always reflects the current database contents. Finally connect the openedWidget event of the view wrapper to the disable action of the main window and connect the closedWidget event of the view wrapper with the enable action of the main window to create a modal window behavior.
6. You have set up the sample to display documents of the Main Topic form, but have not supplied forms for response documents or responses to response documents. Add a Message Prompter to the free from surface and connect the NOTE_Response and the NOTE_Response to Response events of the viewTable to the prompt action of the message prompter. Double click on the prompter to set the prompter message. Set the messageString attribute to This sample is configured to display Main Documents only.
Save the part. You are now ready to test the part. If anything does not work as expected, compare your work with the sample code in AbtNotesDemoApp45. You can enhance the sample with additional form parts to display response documents and responses to response documents.
Last modified date: 01/29/2015