String result = null;
Object item = valueForBinding("selectsItem");
NSArray list = (NSArray) valueForBinding("list");
String popupName = (String) valueForBinding("popupName");
if (list != null && item != null) {
int index = list.indexOfObject(item);
if (index == -1) {
log.info(item + " could not be found in " + list);
}
// by default we assume that there is one more item on top of the
// list (i.e. - none - or - pick one -)