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.
1. Select Domino Parts from the parts palette and add a Domino View part to the free form surface. If you have not already done so, create a connection specification named MyDiscussionSample for the local \vasample\vadis45.nsf database. Double-click the view part to open the settings page. From the Alias Name dropdown listbox select the MyDiscussionSample connection alias. The view part is now reading structural information about the sample database. From the View Name dropdown list select By Author . Select the Error Reporter Creation Automatic check box to make the part ready for automatic error handling. Select OK to close the settings page. You have now configured the view part to represent the "By Author" view of the discussion sample database.
2. Connect the aboutToOpenWidget event of the main window to the open action of the view part to initialize the part during runtime. Connect the aboutToCloseWidget event of the main window to the close action of the view part to free resources when the program ends.
3. Tear off the viewName attribute of the view part and place it on the free form surface. Connect the primary attribute of the viewName part with the title attribute of the main window to display the view name at runtime.
4. Select Quick Form for the ViewTable attribute from the view parts pop up menu to create a visual representation for the view and place the list into the main window. Remove the second column from the listbox (the sample does not display the creation dates of the documents).
5. Add the following entry field on the main window: Categories (text), Contents (multiline edit). Set the converter attributes of the entry fields: NotesText List for the Category field and NotesComposite for the multiline edit field. Add a toggle button named hasChildren to the main window. Now tear off the selectedRow attribute from the viewTable. The selectedRow attribute represents the data of the selected row in the Domino views visual representation.
6. Connect the hasChildren attribute of the selectedRow tear off to the selection attribute of the hasChildren toggle button. This causes the toggle button to display whether a selected entry in the tree view is expandable. You will notice during runtime, that the selection is set as soon as you click on any document or category.
7. The item values of a document can be displayed in the Categories and Contents fields. To display the values you have to open the document and get the individual item values. To do that you need a Domino Form part. Add a Domino Form part to the free form surface and rename it to MainTopicForm. Configure the Domino Form Part to represent the Main Topic form of the sample database. Tear off the currentNote attribute of the form part and connect the categories attribute of the currentNote to the object attribute of the Categories entry field. Connect the body attribute of the currentNote to the object attribute of the Contents field . To activate the Main Topic form part, connect the Note_ANY event of the viewTable with the editNote: action of the form part. When the event is signaled, the form part implicitly opens the selected document and places it in the currentNote attribute. The item values are being displayed in the corresponding entry fields.
8. Add a button labeled Update to the main window and connect the clicked event of the button with the update action of the view part. This button can be used to refresh the view. If the sample application starts and does not display any items in the list, press the Update button.
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 will notice that at runtime you have to double-click on a selected document to display the item values. If you double-click on a category (which is not a real document) nothing will be displayed in the Contents and Categories fields. If you click on a response document, you will only get information in the Contents field because the response document does not contain an item named Categories.
Last modified date: 01/29/2015