background image

UISelectBoolean Properties

<< UIData Properties | UISelectOne Properties >>
<< UIData Properties | UISelectOne Properties >>

UISelectBoolean Properties

expression refers to the item property of ShoppingCartItem, which returns a Book bean. The
title
part of the expression refers to the title property of Book. The value of the UIOutput
component corresponding to this tag is bound to the title property of the Book bean:
private String title = null;
public String getTitle() {
return this.title;
}
public void setTitle(String title) {
this.title=title;
}
UISelectBoolean
Properties
Properties that hold the UISelectBoolean component's data must be of boolean or Boolean
type. The example selectBooleanCheckbox tag from the section
"Rendering Components for
Selecting One Value" on page 343
binds a component to a property. Here is an example that
binds a component value to a property:
<h:selectBooleanCheckbox title=
"#{bundle.receiveEmails}"
value=
"#{custFormBean.receiveEmails}" >
</h:selectBooleanCheckbox>
<h:outputText value=
"#{bundle.receiveEmails}">
Here is an example property that can be bound to the component represented by the example
tag:
protected boolean receiveEmails = false;
...
public void setReceiveEmails(boolean receiveEmails) {
this.receiveEmails = receiveEmails;
}
public boolean getReceiveEmails() {
return receiveEmails;
}
UISelectMany
Properties
Because a UISelectMany component allows a user to select one or more items from a list of
items, this component must map to a bean property of type List or array. This bean property
represents the set of currently selected items from the list of available items.
Here is the example selectManyCheckbox tag from
"Rendering Components for Selecting
Multiple Values" on page 345
:
<h:selectManyCheckbox
id=
"newsletters"
layout=
"pageDirection"
Writing Bean Properties
Chapter 12 · Developing with JavaServer Faces Technology
383