Package org.springframework.springfaces.selectitems

Examples of org.springframework.springfaces.selectitems.SelectItems$AdaptingIterator


    return Collections.singleton(value).iterator();
  }

  private Iterator<SelectItem> newSelectItemsIterator(final UISelectItems component) {
    final String var = (String) component.getAttributes().get("var");
    SelectItems selectItems = new SelectItems(component.getValue()) {
      @Override
      protected SelectItem convertToSelectItem(final Object value) {
        return FacesUtils.doWithRequestScopeVariable(SelectItemsIterator.this.context, var, value,
            new Callable<SelectItem>() {
              public SelectItem call() throws Exception {
                Map<String, Object> attrs = component.getAttributes();
                Object itemValue = firstNonNullValue(attrs.get("itemValue"), value);
                String itemLabel = getStringValue(firstNonNullValue(attrs.get("itemLabel"), itemValue));
                SelectItem item = new SelectItem(itemValue, itemLabel);
                item.setDescription(getStringValue(attrs.get("itemDescription")));
                item.setEscape(getBooleanValue(attrs.get("itemLabelEscaped")));
                item.setDisabled(getBooleanValue(attrs.get("itemDisabled")));
                item.setNoSelectionOption(getBooleanValue(firstNonNullValue(
                    attrs.get("noSelectionOption"), attrs.get("noSelectionValue"))));
                return item;
              }
            });
      }
    };
    return selectItems.iterator();
  }
View Full Code Here

TOP

Related Classes of org.springframework.springfaces.selectitems.SelectItems$AdaptingIterator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.