Adding a View to a Portlet
When you create a portlet, it is created with a default view file. An edit or help view may be present if you specified other portlet modes. These views, or
pages, are created as JSF View Declaration Language (VDL) files. You can drag a control from the Palette view onto the VDL file displayed in the editor. For more information, see
Adding a Control to a Portlet View.
You can add additional views to the portlet to extend the portlet functionality. You can use one of the available predefined view templates to create the view, or you can add an empty view using this procedure.
Note: | Creation of a new portlet view is subject to the UI Development preference Prefer JSF 2.x xhtml Facelet Templates for New Pages. For more information, see Disabling Facelets Functionality
for New Projects and Views. It is possible to override this preference as described in the following procedure. |
To add a view to a portlet
1. In the UI Development perspective, in the Navigation view, open the portlet application project and expand the WebContent folder.
2. Select the portlet that will receive the new VDL file, and right-click New > Portlet View.
3. In the JSF Portlet View wizard, type a name for the VDL file in the File name field.
Note: | If you type the file name only, without a file name extension, the view file will be created according to the setting of the Prefer JSF 2.x xhtml Facelet Templates for New Pages preference. That is, either as a .view file or as a .xhtml file. However, if you type the file name with either a .view or .xhtml file name extension, the view file will be created as specified, regardless of the preference setting. |
4. (Optional) Click Advanced if you want to link to an existing file in your file system.
5. Click Next
6. In the For Portlet list, select the portlet where you want to create the view.
7. In For Portlet Mode, click the portlet mode you want to apply to this view. For more information, see About Portlet Modes. 8. In the Template list, select a template to use for the VDL file:
Template | Description |
Form | (Default) Creates a basic view with a Formatted Message control and a JSF command form. You can modify the view to your desired implementation. |
Empty | Creates a basic view with no components other than a View Root control. You can modify the view to your desired implementation. |
Search Bar | Creates a predefined view for use in developing a search bar portlet. Contains user interface elements that enable the user to enter search criteria, set options, and save searches. |
Task Notification | Creates a task notification view. This is generally selected when you are working with a task application project. For more information, see the webMethods BPM Task Development Help. |
9. Click Next.
10. In the Managed Bean Scope list, choose the scope for portlet view. For more information, see About Managed Beans. 11. Click Next to specify any custom settings you want to apply to the view, or click Finish to create the view with the remaining default settings.
The new view appears in the design canvas (a JSF graphical editor), and in the Solutions view, the Navigator view, or the Package Explorer view, depending on the project type.