How to Become a Revolutionist
This entry is the continuation of my previous entry: A Revolutionary Understanding This example will use an Action Button on a Form to access and update the selected document in an Embedded View. Thanks to Nathan Freeman and his Revolution, I’m able to do something today that I had long ago accepted as impossible.
All of the code required for this adds up to about 75 lines spread across four Notes Design elements (two script libraries, one form, and one view). Much of the code is simple too. If you’ve ever built a class in LotusScript, you should be able to handle this with ease. The following is a breakdown of the approach I used and my limited understanding of how this works. Anyone who wants to fill in details on this process via comments will be lavished with appropriate praise.
A Revolution in Five Easy Steps Each section below links to a portion of a mind map I put together to help describe this. The entire mind map is included below as a PDF. Also, please download and experiment with the example database: 1. Create the Shared Object Library. This library contains a class that makes available any Notes Objects, custom class objects, or variables that you want to share between previously disconnected Notes Objects (like a parent form and embedded view). View the example code 2. Create the Shared Context Library. Create a second script library. This library contains a very simple class and a global variable that is an instance of the class. This variable (“Wrapper”) allows us to hand our SharedObjects class from one NotesObject to another at run-time. View the example code 3. Setup the Embedded View. After you’ve created an embedded view that displays child documents for the currently open parent, this step adds code to the Globals section and View section of the embedded view that will hand off an instance of the SharedObjects class. View the example code 4. Setup the Parent Form Events and Globals. Assuming you have already created a “Parent” form into which you have embedded the above mentioned view, we now want to setup this form to receive our shared instance of the SharedObjects class from the embedded view. This is done by adding some code to the Globals section and Form section of the form. View the example code 5. Create the Update Selected Child Action Button. Create a new Action button on the Parent form. This action button will now have access (via our variables defined in the Globals section and set in the Postmodechange event of the form) to the shared instance of our Shared Objects class. Now we can use this access to work directly with the UIView object of the embedded view! View the example code
Click here to get the full mind map as a PDF. Click here to download the example database as a zip file. It was built using Notes 7.0.3
|
How to Become a Revolutionist
|