10.12.2012 Views

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Registering a Custom Renderer with a Render Kit<br />

8. Select <strong>Java</strong>Server Faces → Add Navigation Case.<br />

9. In the Add Navigation Case dialog:<br />

a. From the From View menu, select the page that represents the starting view for the<br />

navigation rule (from step 6a).<br />

b. (optional) In the From Action field, enter the action method invoked when the<br />

component that triggered navigation is activated.<br />

c. (optional) In the From Outcome field, enter the logical outcome string that the activated<br />

component references from its action attribute.<br />

d. From the To View menu, select or browse for the page that will be opened if this<br />

navigation case is selected by the navigation system.<br />

e. Click Add.<br />

“Referencing a Method That Performs Navigation” on page 369 explains how to use a<br />

component tag’s action attribute to point to an action method. “Writing a Method to<br />

Handle Navigation” on page 402 explains how to write an action method.<br />

Registering a Custom Renderer with a Render Kit<br />

452<br />

When the application developer creates a custom renderer, as described in “Delegating<br />

Rendering to a Renderer” on page 425, you must register it using the appropriate render kit.<br />

Because the image map application implements an HTML image map, AreaRenderer (as well<br />

as MapRenderer) should be registered using the HTML render kit.<br />

You register the renderer using the render-kit element of the application configuration<br />

resource file. Here is the configuration of AreaRenderer from the Duke’s Bookstore application:<br />

<br />

<br />

Area<br />

DemoArea<br />

<br />

com.sun.bookstore6.renderers.AreaRenderer<br />

<br />

<br />

onmouseout<br />

java.lang.String<br />

<br />

<br />

onmouseover<br />

java.lang.String<br />

<br />

<br />

styleClass<br />

<strong>The</strong> <strong>Java</strong> <strong>EE</strong> 5<strong>Tutorial</strong> • June 2010

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!