use of javax.faces.model.SelectItem in project oxTrust by GluuFederation.
the class UpdateAsimbaSPRequestorAction method refresh.
public void refresh() {
log.info("refresh() SPRequestor call");
if (searchPattern == null || "".equals(searchPattern)) {
// list loading
spRequestorList = asimbaService.loadRequestors();
} else {
// search mode, clear pattern
searchPattern = null;
}
// fill spPoolList
spPoolList = new ArrayList<SelectItem>();
List<RequestorPoolEntry> spPoolListEntries = asimbaService.loadRequestorPools();
for (RequestorPoolEntry entry : spPoolListEntries) {
spPoolList.add(new SelectItem(entry.getId(), entry.getId(), entry.getFriendlyName()));
}
}
use of javax.faces.model.SelectItem in project oxTrust by GluuFederation.
the class UpdateAsimbaSelectorAction method refresh.
public void refresh() {
log.info("refresh() Selector call");
if (searchPattern == null || "".equals(searchPattern)) {
//list loading
selectorList = asimbaService.loadSelectors();
} else {
// search mode, clear pattern
searchPattern = null;
}
// Load edit lists
idpList = new ArrayList<SelectItem>();
List<IDPEntry> idpListEntries = asimbaService.loadIDPs();
for (IDPEntry entry : idpListEntries) {
idpList.add(new SelectItem(entry.getId(), entry.getId(), entry.getFriendlyName()));
}
spRequestorList = new ArrayList<SelectItem>();
List<RequestorEntry> spRequestorListEntries = asimbaService.loadRequestors();
for (RequestorEntry entry : spRequestorListEntries) {
spRequestorList.add(new SelectItem(entry.getId(), entry.getId(), entry.getFriendlyName()));
}
}
use of javax.faces.model.SelectItem in project tomee by apache.
the class JsfUtil method getSelectItems.
public static SelectItem[] getSelectItems(final List<?> entities, final boolean selectOne) {
final int size = selectOne ? entities.size() + 1 : entities.size();
final SelectItem[] items = new SelectItem[size];
int i = 0;
if (selectOne) {
items[0] = new SelectItem("", "---");
i++;
}
for (final Object x : entities) {
items[i++] = new SelectItem(x, x.toString());
}
return items;
}
Aggregations