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.

An editable text component in a <strong>Java</strong>Server Faces application is represented by a UIInput<br />

component. One example is a text field. A read-only text component in a <strong>Java</strong>Server Faces<br />

application is represented by a UIOutput component. One example is a label.<br />

<strong>The</strong> UIInput and UIOutput components can each be rendered in four ways to display more<br />

specialized text components. Table 11–3 lists all the renderers of UIInput and UIOutput and the<br />

tags that represent the component and renderer combination. Recall from “Component<br />

Rendering Model” on page 299 that the name of a tag is composed of the name of the<br />

component and the name of the renderer. For example, the inputText tag refers to a UIInput<br />

component that is rendered with the Text renderer.<br />

TABLE 11–3 UIInput and UIOutput Tags<br />

Component Renderer Tag Function<br />

UIInput Hidden inputHidden Allows a page author to include a hidden variable in a<br />

page<br />

Secret inputSecret <strong>The</strong> standard password field: Accepts one line of text with<br />

no spaces and displays it as a set of asterisks as it is typed<br />

Text inputText <strong>The</strong> standard text field: Accepts a text string of one line<br />

TextArea inputTextarea <strong>The</strong> standard text area: Accepts multiple lines of text<br />

UIOutput Label outputLabel <strong>The</strong> standard read-only label: Displays a component as a<br />

label for a specified input field<br />

Link outputLink Displays an tag that links to another page<br />

without generating an action event<br />

OutputMessage outputFormat Displays a localized message<br />

Adding UI Components to a Page Using the HTML ComponentTags<br />

Text outputText Displays a text string of one line<br />

<strong>The</strong> UIInput component tags support the following tag attributes in addition to those described<br />

at the beginning of “Adding UI Components to a Page Using the HTML Component Tags” on<br />

page 325. This list does not include all the attributes supported by the UIInput component tags,<br />

just those that page authors will use most often. Please refer to the html_basic.tld file for the<br />

complete list.<br />

■ converter: Identifies a converter that will be used to convert the component’s local data. See<br />

“Using the Standard Converters” on page 352 for more information on how to use this<br />

attribute.<br />

■ converterMessage: Specifies an error message to display when the converter registered on<br />

the component fails.<br />

■ dir: Specifies the direction of the text displayed by this component. Acceptable values are<br />

LTR, meaning left-to-right, and RTL, meaning right-to-left.<br />

■ label: Specifies a name that can be used to identify this component in error messages.<br />

Chapter 11 • Using <strong>Java</strong>Server FacesTechnology in JSP Pages 329

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

Saved successfully!

Ooh no, something went wrong!