Package javax.faces.component

Examples of javax.faces.component.UISelectItems


        HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateBasicAttrs();
       
        List items = new ArrayList();
        items.add(new SelectItem("mars"));

        UISelectItems selectItems = new UISelectItems();
        selectItems.setValue(items);

        selectOneMenu.getChildren().add(selectItems);
       
        HtmlCheckAttributesUtil.checkRenderedAttributes(
                selectOneMenu, facesContext, writer, attrs);
View Full Code Here


        HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateBasicAttrs();
       
        List items = new ArrayList();
        items.add(new SelectItem("mars"));

        UISelectItems selectItems = new UISelectItems();
        selectItems.setValue(items);

        selectManyMenu.getChildren().add(selectItems);
       
        HtmlCheckAttributesUtil.checkRenderedAttributes(
                selectManyMenu, facesContext, writer, attrs);
View Full Code Here

        };
       
        List<SelectItem> items = new ArrayList<SelectItem>();
        items.add(new SelectItem("mars"));

        UISelectItems selectItems = new UISelectItems();
        selectItems.setValue(items);

        selectOneRadio.getChildren().add(selectItems);

        HtmlCheckAttributesUtil.checkRenderedAttributes(
                selectOneRadio, facesContext, writer, attrs);
View Full Code Here

                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();) {
View Full Code Here

        };
       
        List<SelectItem> items = new ArrayList<SelectItem>();
        items.add(new SelectItem("mars"));

        UISelectItems selectItems = new UISelectItems();
        selectItems.setValue(items);

        selectOneRadio.getChildren().add(selectItems);

        HtmlCheckAttributesUtil.checkRenderedAttributes(
                selectOneRadio, facesContext, writer, attrs);
View Full Code Here

    if (LOG.isDebugEnabled()) {
      for (Object o : selectOne.getChildren()) {
        LOG.debug("ITEMS " + o);
        if (o instanceof UISelectItems) {
          UISelectItems uiitems = (UISelectItems) o;
          Object v = uiitems.getValue();
          LOG.debug("VALUE " + v);
          if (v != null) {
            LOG.debug("VALUE " + v.getClass().getName());
          }
        }
View Full Code Here

    @Override
    public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String rawValue) {
        Corporation result = null;
        if (uiComponent instanceof HtmlSelectOneMenu) {
            HtmlSelectOneMenu menu = (HtmlSelectOneMenu) uiComponent;
            UISelectItems items = (UISelectItems) menu.getChildren().get(0);
            List obj = (List) items.getValue();
            for (Iterator it = obj.iterator(); it.hasNext();) {
                Corporation corpo = (Corporation) it.next();
                if (corpo.getId().equals(Long.valueOf(rawValue))) {
                    result = corpo;
                    break;
View Full Code Here

    @Override
    public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String rawValue) {
        Corporation result = null;
        if (uiComponent instanceof HtmlSelectOneMenu) {
            HtmlSelectOneMenu menu = (HtmlSelectOneMenu) uiComponent;
            UISelectItems items = (UISelectItems) menu.getChildren().get(0);
            List obj = (List) items.getValue();
            for (Iterator it = obj.iterator(); it.hasNext();) {
                Corporation corpo = (Corporation) it.next();
                if (corpo.getId().equals(Long.valueOf(rawValue))) {
                    result = corpo;
                    break;
View Full Code Here

        };
       
        List<SelectItem> items = new ArrayList<SelectItem>();
        items.add(new SelectItem("mars"));

        UISelectItems selectItems = new UISelectItems();
        selectItems.setValue(items);

        selectOneRadio.getChildren().add(selectItems);

        HtmlCheckAttributesUtil.checkRenderedAttributes(
                selectOneRadio, facesContext, writer, attrs);
View Full Code Here

        }

        // if this component is a SelectOne or SelectMany, take special action
        if (isMultiValue(componentType)) {
            // create a UISelectItems instance
            UISelectItems items = new UISelectItems();
            items.setValue(parseStringIntoArrayList(value, converter));
            // add it to the component
            component.getChildren().add(items);
        } else {
            // we have a single value
            if (null != converter) {
View Full Code Here

TOP

Related Classes of javax.faces.component.UISelectItems

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.