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.

private String title = null;<br />

public String getTitle() {<br />

return this.title;<br />

}<br />

public void setTitle(String title) {<br />

this.title=title;<br />

}<br />

UISelectBoolean Properties<br />

Properties that hold the UISelectBoolean component’s data must be of boolean or Boolean<br />

type. <strong>The</strong> example selectBooleanCheckbox tag from the section “Rendering Components for<br />

Selecting One Value” on page 341 binds a component to a property. Here is an example that<br />

binds a component value to a property:<br />

<br />

<br />

<br />

Here is an example property that can be bound to the component represented by the example<br />

tag:<br />

protected boolean receiveEmails = false;<br />

...<br />

public void setReceiveEmails(boolean receiveEmails) {<br />

this.receiveEmails = receiveEmails;<br />

}<br />

public boolean getReceiveEmails() {<br />

return receiveEmails;<br />

}<br />

UISelectMany Properties<br />

Because a UISelectMany component allows a user to select one or more items from a list of<br />

items, this component must map to a bean property of type List or array. This bean property<br />

represents the set of currently selected items from the list of available items.<br />

Here is the example selectManyCheckbox tag from “Rendering Components for Selecting<br />

Multiple Values” on page 343:<br />

<br />

<br />

<br />

Writing Bean Properties<br />

Chapter 12 • Developing with <strong>Java</strong>Server FacesTechnology 381

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

Saved successfully!

Ooh no, something went wrong!