Steps for Creating a Custom Component (original) (raw)

You can apply the following steps while developing your own custom component.

  1. Create a custom component class that does the following:
  2. Overrides the getFamily method to return the component family, which is used to look up renderers that can render the component
  3. Includes the rendering code or delegates it to a renderer (explained in Step 2)
  4. Enables component attributes to accept expressions
  5. Queues an event on the component if the component generates events
  6. Saves and restores the component state
  7. Delegate rendering to a renderer if your component does not handle the rendering. To do this:
  8. Create a custom renderer class by extendingjavax.faces.render.Renderer.
  9. Register the renderer to a render kit.
  10. Register the component.
  11. Create an event handler if your component generates events.
  12. Create a tag library descriptor (TLD) that defines the custom tag.