tell me more icon Binding to a Dynamic List

The af:selectOneListbox component (and other similar select input components) can contain one f:selectItems component for representing the items in the list. For the af:selectOneListbox component to be populated with an initial list of items at runtime, you value bind the f:selectItems component (through its value attribute) to a getter method on a managed bean that returns an array of javax.faces.model.SelectItem instances.

In the previous card, you have already created a property and a getter method in a managed bean that returns a List of SelectItem instances:

                               
private List<SelectItem> _choices;

public List<SelectItem> getChoices() {
    if (_choices == null) {
        _choices = new ArrayList<SelectItem>();
        _choices.add(new SelectItem("Cocoa", "Cocoa"));
        _choices.add(new SelectItem("Tea", "Tea"));
        _choices.add(new SelectItem("Wine", "Wine"));
    }
    return _choices;
} 
                            

In the Insert Select One Listbox wizard, when you choose to bind the af:selectOneListbox component to a list, JDeveloper displays the Expression Builder where you select the choices property on the managed bean to value bind the f:selectItems component.

Expression Builder

Copyright © 1997, 2009, Oracle. All rights reserved.

false ,,,,,,,,,,,,,,,