The primary responsibility of a component is to decode and encode data. encode = convert request parameters to component attributes decode = render component attributes to the view (render html mostly...) The rendering can be directly implemented by the component or can be delegated to a renderer. We use a special renderer(s) when we want different types of rendering for that component (maybe for different display devices). So a JSF component has 2 parts: the component + renderer Image by Rick Hightower explaining on where rendering fits in the JSF lifecycle - Ref All custom components have to be subclasses of UIComponent. However, we subclass UICOmponentBase which is an abstract class that gives us a skeletal implementation of UIComponent. Creating the custom component: As an exercise, I will create a simple custom component that renders a 5x5 grid (as an html table). Here are the steps: Create a subclass of UIComponent (I chose UIOutput, since this is an output only component, ie. we...
Write Awesome User Manuals and Tutorials for Software Products