UISelectItem uiSelectItem = (UISelectItem) child;
selectItems.add(new SelectItem(uiSelectItem.getItemValue(), uiSelectItem.getItemLabel()));
}
else if(child instanceof UISelectItems) {
UISelectItems uiSelectItems = ((UISelectItems) child);
Object value = uiSelectItems.getValue();
if(value instanceof SelectItem[]) {
selectItems.addAll(Arrays.asList((SelectItem[]) value));
}
else if(value instanceof Map) {
Map map = (Map) value;
for(Iterator it = map.keySet().iterator(); it.hasNext();) {
Object key = it.next();
selectItems.add(new SelectItem(map.get(key), String.valueOf(key)));
}
}
else if(value instanceof Collection) {
Collection collection = (Collection) value;
String var = (String) uiSelectItems.getAttributes().get("var");
if(var != null) {
for(Iterator it = collection.iterator(); it.hasNext();) {
Object object = it.next();
context.getExternalContext().getRequestMap().put(var, object);
String itemLabel = (String) uiSelectItems.getAttributes().get("itemLabel");
Object itemValue = uiSelectItems.getAttributes().get("itemValue");
selectItems.add(new SelectItem(itemValue, itemLabel));
}
} else {
for(Iterator it = collection.iterator(); it.hasNext();) {