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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

alt="#{bundle.ChooseLocale}"<br />

usemap="#worldMap" /><br />

<br />

<br />

<br />

<br />

<br />

<br />

...<br />

<br />

<br />

<strong>The</strong> alt attribute of graphicImage maps to the localized string "Choose Your Locale from<br />

the Map".<br />

<strong>The</strong> actionListener attribute of the map tag points at a method in LocaleBean that accepts an<br />

action event. This method changes the locale according to the area selected from the image<br />

map. <strong>The</strong> way this event is handled is explained more in “Handling Events for Custom<br />

Components” on page 427.<br />

<strong>The</strong> action attribute specifies a logical outcome String, which is matched against the<br />

navigation rules in the application configuration resource file. For more information on<br />

navigation, see the section “Configuring Navigation Rules” on page 449.<br />

<strong>The</strong> immediate attribute of the map tag is set to true, which indicates that the default<br />

ActionListener implementation should execute during the apply request values phase of the<br />

request-processing life cycle, instead of waiting for the invoke application phase. Because the<br />

request resulting from clicking the map does not require any validation, data conversion, or<br />

server-side object updates, it makes sense to skip directly to the invoke application phase.<br />

<strong>The</strong> current attribute of the map tag is set to the default area, which is NAmerica.<br />

Understanding the Image Map Example<br />

Notice that the area tags do not contain any of the <strong>Java</strong>Script, coordinate, or shape data that is<br />

displayed on the HTML page. <strong>The</strong> <strong>Java</strong>Script is generated by the AreaRenderer class. <strong>The</strong><br />

Chapter 13 • Creating Custom UI Components 413

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

Saved successfully!

Ooh no, something went wrong!