Java Reference
In-Depth Information
Click here to view code image
sb = new StringBuffer("document.forms[0]['").append(targetImageId).
append("'].src='");
sb.append(
getURI(context,
(String) area.getAttributes().get("onmouseout")));
sb.append("'");
writer.writeAttribute("onmouseout", sb.toString(), "onmouseout");
sb = new StringBuffer("document.forms[0]['").append(targetImageId).
append("'].src='");
sb.append(
getURI(context,
(String) area.getAttributes().get("onmouseover")));
sb.append("'");
writer.writeAttribute("onmouseover", sb.toString(), "onmouseover");
sb = new StringBuffer("document.forms[0]['");
sb.append(getName(context, area));
sb.append("'].value='");
sb.append(iarea.getAlt());
sb.append("'; document.forms[0].submit()");
writer.writeAttribute("onclick", sb.toString(), "value");
writer.endElement("area");
By submitting the page, this code causes the JavaServer Faces lifecycle to return back to
the Restore View phase. This phase saves any state information, including the value of the
hidden field, so that a new request component tree is constructed. This value is retrieved
by the decode method of the MapComponent class. This decode method is called by
the JavaServer Faces implementation during the Apply Request Values phase, which fol-
lows the Restore View phase.
In addition to the encodeEnd method, AreaRenderer contains an empty constructor.
This is used to create an instance of AreaRenderer so that it can be added to the render
kit.
The @FacesRenderer annotation registers the renderer class with the JavaServer Faces
implementation as a renderer class. The annotation identifies the component family as
well as the renderer type.
Identifying the Renderer Type
During the Render Response phase, the JavaServer Faces implementation calls the
getRendererType method of the component's tag handler to determine which render-
er to invoke, if there is one.
Search WWH ::




Custom Search