You can drag the Standard JavaServer Faces Radio Button List component
from
the Palette to the Visual Designer to create a table initially
containing three radio buttons in single row.
A Radiobutton List is a composite component: the enclosing
component (radioButtonList) manages the style and behavior of
the list itself, and the inside component (radioButtonListSelectItems)
is used to bind to the actual items in the list. A third, related
component named radioButtonListDefaultItems is created for each
Radiobutton List component that you add to the page and contains
an array of static default items for the list (item1
,
item2
, item3
). This last component is not
one that you typically work with. You can see all these components
in the Navigator window after you add a Radiobutton List to your page.
A Radiobutton List renders as an HTML <table>
containing <input style="radio">
in
each cell. Each <input>
is enclosed in a <label>
to provide the label for each button.
After adding a Radiobutton List Component to a Visual Web JSF page, you can do a number of things with it:
id
attribute. In the page bean, this property's
value is the name of the HtmlSelectOneList
object.radioButtonListSelectItems
part of the component, not by the value property. See
the Bind List Items to Database selection's description below
for a typical way to set the radioButtonListSelectItems
part of the component.
You might also right-click the radioButtonListSelectItems node in the Navigator window and choose Property Bindings to bind its value property to a property of the session bean that populates the list. See the session bean description in Navigator Window for more information.
validate
method
so you can insert code to validate the value of the
component.processValueChange
method so you can insert code that executes when the
value of this component changes (for example, the user
changes the value of another component that is controlling
the selected radio button in this component).value
property to an object or to a data provider, as described in Bind to Data Dialog Box. common_timeoutSubmitForm(this.form, 'component-id');
. At runtime, this code causes the form to be automatically submitted if the user changes the component value. Once the form is submitted, conversion and validation occur on the server and any value change listener methods execute, and then the page is redisplayed.
A component configured to Auto-Submit on Change can use virtual forms to limit the input fields that are processed when the form is submitted. If the auto-submit component is defined to submit a virtual form, only the participants in that virtual form will be processed when the auto-submit occurs.