# Adding a Component

You can develop a new JavaServer Faces (JSF) Component. Using the Component section of the JSF Application Configuration editor Component page, you can register a component and its associated classes. Generally, a JSF component is composed of a set of classes, such as the component class, its render class, and so on. See the JSF specification and tutorial on java.sun.com for component development details.

To add a component:

1. Select faces-config.xml in the Project Explorer of the J2EE perspective.

   The JSF Application Configuration editor opens.

2. Select the Component tab of the editor.

   The Faces Configuration Components page appears.

3. Expand the Components section.

   Defined components display in the components list.

4. Click Add.

   A new component x is added to the list and General, Facets, Attributes, and Properties sections appear.

5. (Optional) Change the default name to a unique, descriptive name in the Display Name field of the General section.

6. (Optional) Type a description of the component in the Description field.

7. Type the type in the Component Type field.

8. Click Browse.

   The Select Type dialog box appears.

9. Type the first letter of the type you want to use in the Select entries field.

   A list of available types beginning with the letter you typed appears in the Matching types list.

10. Select the type that you want to use and click OK.

11. Click Add in the Facets section.

    The Add/Edit Facet dialog box appears.

12. Type a facet name, display name, and description and click Finish.

13. Click Add in the Attributes section.

    The Add/Edit Attribute dialog box appears.

14. Type a unique, descriptive name in the Attribute Name field.

15. Click Browse.

16. Type the first letter of the type you want to use in the Select entries field.

    A list of available types beginning with the letter you typed appears in the Matching types list.

17. Select the type that you want to use and click OK.

18. Type a value in the Default Value field.

19. (Optional) Type a value in the Suggested Value field.

20. Click Add in the Properties section.

    The Add/Edit Property dialog box appears.

21. Type a unique, descriptive name in the Property Name field.

22. Click Browse.

23. Type the first letter of the type you want to use in the Select entries field.

    A list of available types beginning with the letter you typed appears in the Matching types list.

24. Select the type that you want to use and click OK.

25. Type a value in the Default Value field.

26. (Optional) Type a value in the Suggested Value field.

JSF Application Configuration

Faces Config Editor

Tutorial