In my introduction to XPages in Domino 8.5, I included a basic downloadable example that displays data from a simple view. In a real application, you would also want to examine individual documents behind a view and possibly modify selected documents. This tip gives you the tools to do this.
To examine the new XPages sample, download it from my website and read my previous article for background information on how to install and run any database that contains XPages.
The value of this example is in seeing how this particular code works, while also serving as a test bed for your own experimentation. Install and run this example as is to make sure that it works. Then, you can modify or extend it for your own applications.
To begin, open the new database with Domino Designer and go to the XPages category. You will see two XPages: LaunchPage and Form1Page.
- LaunchPage is a view-like page that will be displayed when the database is opened with a Web browser.
- Form1Page is an XPage that acts like a Notes form and shows all fields in a single document.
Double-click on LaunchPage to open it. Within LaunchPage, you'll see some plain text and an embedded view control. Next, follow these steps:
Double-click on Form1Page and you will see several labels and fields that are similar to those in a standard Notes form. Next, follow these steps:
Next, look at the database with Lotus Notes 8.5.
- Open the database, which contains a single view, one form and a short list of documents.
- Right click on -> Application -> Properties > Launch to examine the launch property of xpages3.nsf. The browser launch is set to use the XPage named LaunchPage.
Run the full sample from a Web browser to see XPages in action.
- In your Web browser's address bar, enter: http://nnn.nnn.nnn.nnn/xpages3.nsf, where nnn.nnn.nnn.nnn is the IP address or name of your test Domino server.
Notice that xpages3.nsf opens directly to the launch page that you examined and that it displays a view containing the documents of the database.
You can see that the left-hand column of the view contains clickable links. Clicking one should open the underlying document, using the XPage named Form1Page.
You can modify the data in the document then press Submit.
- After doing so, you may need to use the browser's Back button a couple times to return to the launch page and refresh the page to see the modified data.
| ABOUT THE AUTHOR: |
|
Chuck Connell Chuck Connell is president of CHC-3 Consulting, which helps organizations with all aspects of Domino and Notes. |
|