Download
FAQ History |
API
Search Feedback |
Steps for Creating a Custom Component
Before we describe how the image map works, it helps to summarize the basic steps for creating an application that uses custom components. You can apply the following steps while developing your own custom component.
- Write a tag handler class that extends
javax.faces.webapp.UIComponentTag
. In this class, you need agetRendererType
method, which returns the type of your custom renderer if you are using one (explained in step 4); agetComponentType
method, which returns the type of the custom component; and asetProperties
method, in which you set all the new attributes of your component- Create a tag library descriptor (TLD) that defines the custom tag.
- Create a custom component class
- Include the rendering code in the component class or delegate it to a renderer (explained in step 7).
- If your component generates events, queue the event on the component.
- Save and restore the component state.
- Delegate rendering to a renderer if your component does not handle the rendering.
- Register the component
- Create an event handler if your component generates events.
- Declare your new TLD.
The application architect does the work of registering the custom component and the renderer. See Registering a Custom Converter and Registering a Custom Renderer with a Render Kit for more information.
Download
FAQ History |
API
Search Feedback |
All of the material in The J2EE(TM) 1.4 Tutorial is copyright-protected and may not be published in other works without express written permission from Sun Microsystems.