tell me more icon Creating the Metadata for a JSF Declarative Component

To follow along with the example, in this step and throughout the cards, enter values as shown in the instructions. Then you will be able to follow the steps in the cue cards exactly as written.

A declarative component is a reusable, composite component made up of other existing ADF Faces components. Declarative components can be used as a basis for building different portions of a page or multiple pages, with different content or the same content. For instance, if there is a series of buttons that is common across different portions of a page or across multiple pages, you can create a declarative component comprising those buttons and then use that declarative component on the pages that need the common functionality.

Declarative components cannot be used in the same project where the components are defined. In other words, you have to create your declarative components in one project, and your pages that use the declarative components in another project.

To begin creating a declarative component, you will open the Create JSF Declarative Component dialog. To open the dialog, in the Application Navigator, you will right-click the declarative components project node and choose New . Then in the New Gallery, expand the Web Tier category and select JSF, and in the Items list, select JSF Declarative Component.

New Gallery, JSF Declarative Component item

A declarative component is created in a component definition file written in XML; the file has .jspx as the file extension. The declarative component is described in two sections inside the component definition file: a metadata section that contains all the metadata for the component (such as the component's display name and tag library information), and a layout section that contains all the individual ADF Faces components that make up the composite declarative component.

The Create JSF Declarative Component dialog helps you to create the metadata for a declarative component only, such as the declarative component's display name, and any facet definitions, attributes, or methods that the component might include.

Create JSF Declarative Component dialog

The declarative component you are creating will include a menu bar component and a menu component. In the example, you will enter a name for the declarative component, and add a facet definition, an attribute and a method. The attribute will allow page authors to set the label for a menu item component; the method will allow page authors to attach an action listener method to the menu item component; the facet will allow page authors to add additional menu components, if desired.

In the Create JSF Declarative Component dialog, you will also specify new JSP tag library details for the declarative component, that is, the tag library that will contain the declarative component, and how to access the library and declarative component on a page. To add new JSP tag details, you will use the Create Declarative Component Tag Library dialog by clicking Add Ta g Library .

Create Declarative Component Tag Library dialog

Copyright © 1997, 2009, Oracle. All rights reserved.

false ,,,,,,,,,,,,,,,