Incorporating a Domino
® view into an XPage makes a good base for an application. The view can be set up to both display and access the application data.
- In the Application Navigator, right-click on XPages and select New XPage.
- Give the XPage the name mainview and click OK.
Designer opens an empty edit area for the new XPage.
To the right of the edit area is the Controls
palette. If you do not see it or close it, click Window
-> Show Eclipse Views
to restore the palette. The second tab on the right is for the Data
palette which you will look at later. Below the edit area are tabs for properties, events, and problems. As controls are placed in the edit area, the properties and events change to reflect what is in focus.
- Look under Container Controls on the right and locate the View control.
- Click and drag the View control into the edit area.
Alternatively, you can double-click the control. For this control, you are presented with a dialog to map the View control to a Domino data source.
- Select main for the Domino view that you want to map to this control.
The data source name view1
is the default - leave this as is. You can choose to omit columns but for this sample let's keep them all.
- Click OK.
control appears, complete with a pager (a control for moving through multiple view pages), column headers, and column data areas.
- Save the XPage. Preview it in Notes®.
- Before previewing in a browser, you must add the user Anonymous to the Access Control List (ACL):
- Click File -> Application -> Access Control.
This brings up the Access Control List dialog.
- Click the Add button.
This brings up the Add User dialog.
- Enter the name Anonymous and click OK.
This closes the Add User dialog. Anonymous is now in the list.
- From the Access drop-down menu, select a level of access for Anonymous. Editor or higher is recommended.
- Click OK.
- To preview the XPage in a browser, click Design -> Preview in Web Browser -> <choice of browser> or click the Preview in Web Browser toolbar icon ..
This renders the XPage in the browser of your choice.
Browser rendering on a workstation is accomplished by a "mini" Domino
server which may take a few seconds to start. Once the mini-server is going, but not before, you can render the XPage directly in a browser by entering its URL in the address bar.
You can obtain the URL during preview. It is the local host followed by the application file name (with nsf
extension) relative to the Domino
server and the file name of the XPage (with xsp
extension), for example:
file is XML but must be processed by a Domino
Parent topic: Your first XPages application