Defining the attributes of the custom component tag

A custom component library contains new and modified JSF components that you can use in your Web applications and distribute the libraries to your development team. By configuring the attributes you are defining and binding new attributes to the JSF components that you create.

  1. Create a custom component library.

  2. Create a custom component.

Defining the attributes for the <jsfc:component> tag allows you to bind the tag to data and control other aspects of component behavior. To define the attributes:

  1. Right-click the <jsfc:component> tag in the source view of the editor and select

    Properties. The Properties view opens.

  2. Add a description for the custom component in the Description field.

  3. In the

    Component behaves as menu, select a control type from the list:

    • Basic JSF component - Acts as a container for other JSF components.

    • Input component - Includes a value attribute and supports ValueChanged events.

    • Multi-select component - Includes a value attribute that an hold multiple objects.

    • Command component - Includes an action attribute and supports Action events.

    Depending on the type of control that you select, the tag will automatically define some attributes for that component. For example, if you specify that the component behaves as an input component, the value attribute is automatically defined.

    You can use the Properties view to edit, add, and remove attributes.

    Tip: Alternatively, you can edit, add, and remove the attributes in the Page Data View. For more information on creating attributes using the Page Data View, refer to Creating attributes for custom components.

    The attributes for the custom component are shown in the Page Data View under the Faces component node.

  4. Save the file.