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.

panelGroup tag. This is because styles such as those that set width and height are not applied to<br />

inline elements, which is how content enclosed by the span element is defined.<br />

A panelGroup tag can also be used to encapsulate a nested tree of components so that the tree of<br />

components appears as a single component to the parent component.<br />

<strong>The</strong> data represented by the nested component tags is grouped into rows according to the value<br />

of the columns attribute of the panelGrid tag. <strong>The</strong> columns attribute in the example is set to 3,<br />

and therefore the table will have three columns. In which column each component is displayed<br />

is determined by the order that the component is listed on the page modulo 3. So if a<br />

component is the fifth one in the list of components, that component will be in the 5 modulo 3<br />

column, or column 2.<br />

Rendering Components for Selecting OneValue<br />

Another common UI component is one that allows a user to select one value, whether it be the<br />

only value available or one of a set of choices. <strong>The</strong> most common examples of this kind of<br />

component are:<br />

■ A check box, which represents boolean state<br />

■ A set of radio buttons<br />

■ A drop-down menu, which displays a scrollable list<br />

■ A list box, which displays an unscrollable list<br />

Figure 11–4 shows examples of these components.<br />

FIGURE 11–4 Example Select One Components<br />

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

Displaying a Check Box Using the selectBooleanCheckbox Tag<br />

<strong>The</strong> UISelectBoolean class defines components that have a boolean value. <strong>The</strong><br />

selectBooleanCheckbox tag is the only tag that <strong>Java</strong>Server Faces technology provides for<br />

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

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

Saved successfully!

Ooh no, something went wrong!