Search in sources :

Example 1 with SelectItem

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()));
    }
}
Also used : RequestorPoolEntry(org.gluu.asimba.util.ldap.sp.RequestorPoolEntry) SelectItem(javax.faces.model.SelectItem)

Example 2 with SelectItem

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()));
    }
}
Also used : SelectItem(javax.faces.model.SelectItem) RequestorEntry(org.gluu.asimba.util.ldap.sp.RequestorEntry) IDPEntry(org.gluu.asimba.util.ldap.idp.IDPEntry)

Example 3 with SelectItem

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;
}
Also used : SelectItem(javax.faces.model.SelectItem)

Aggregations

SelectItem (javax.faces.model.SelectItem)3 IDPEntry (org.gluu.asimba.util.ldap.idp.IDPEntry)1 RequestorEntry (org.gluu.asimba.util.ldap.sp.RequestorEntry)1 RequestorPoolEntry (org.gluu.asimba.util.ldap.sp.RequestorPoolEntry)1