Java Reference
In-Depth Information
• Rendering the HTML map tag and the HTML input tag
MapComponent delegates the rendering of the HTML map and input tags to the
MapRenderer class.
AreaComponent is bound to a bean that stores the shape and coordinates of the region
of the image map. You will see how all this data is accessed through the value expression
in “ Creating the Renderer Class on page 115 . The behavior of AreaComponent con-
sists of the following:
• Retrieving the shape and coordinate data from the bean
• Setting the value of the hidden tag to the id of this component
• Rendering the area tag, including the JavaScript for the onmouseover , on-
mouseout , and onclick functions
Although these tasks are actually performed by AreaRenderer , AreaComponent
must delegate the tasks to AreaRenderer . See “ Delegating Rendering to a Renderer
on page 114 for more information.
The rest of this section describes the tasks that MapComponent performs as well as the
encoding and decoding that it delegates to MapRenderer . “ Handling Events for Custom
Components on page 119 details how MapComponent handles events.
Specifying the Component Family
If your custom component class delegates rendering, it needs to override the getFamily
method of UIComponent to return the identifier of a component family , which is used
to refer to a component or set of components that can be rendered by a renderer or set of
renderers.
The component family is used along with the renderer type to look up renderers that can
render the component:
public String getFamily() {
return ("Map");
}
The component family identifier, Map , must match that defined by the component-
family elements included in the component and renderer configurations in the applic-
ation configuration resource file. “ Registering a Custom Renderer with a Render Kit ” on
page 165 explains how to define the component family in the renderer configuration. Re-
gistering a Custom Component on page 167 explains how to define the component fam-
ily in the component configuration.
Search WWH ::




Custom Search