Package javax.faces.component

Examples of javax.faces.component.UISelectItem


            if (workflowStates != null) {
                HtmlOutputText outputWorkflowState = new HtmlOutputText();
                outputWorkflowState.setValue(Messages.getStringJSF("constraint.info.workflowState"));
                panel.getChildren().add(outputWorkflowState);
                HtmlSelectOneMenu select = new HtmlSelectOneMenu();
                UISelectItem item = new UISelectItem();
                item.setItemValue(null);
                item.setItemLabel(Messages.getStringJSF("constraint.workflowstate.all"));
                select.getChildren().add(item);
                select.setId("workflowState" + getItemUuid());
                for (WorkflowState workflowState : workflowStates) {
                    item = new UISelectItem();
                    item.setItemValue(workflowState.getUuid());
                    item.setItemLabel(workflowState.getDisplayName());
                    select.getChildren().add(item);
                }
                panel.getChildren().add(select);
            }
            HtmlOutputText outputConstraintType = new HtmlOutputText();
            outputConstraintType.setValue(Messages.getStringJSF("constraint.info.constraintType"));
            panel.getChildren().add(outputConstraintType);
            HtmlSelectOneMenu select = new HtmlSelectOneMenu();
            select.setId("constraintType" + getItemUuid());
            for (ConstraintType constraintType : ConstraintType.values()) {
                if (constraintType != ConstraintType.DEFAULT) {
                    UISelectItem item = new UISelectItem();
                    item.setItemValue(constraintType);
                    item.setItemLabel(Messages.getStringJSF("ConstraintType." + constraintType.name()));
                    select.getChildren().add(item);
                }
            }
            panel.getChildren().add(select);
            if (constraintClients != null) {
                HtmlOutputText outputConstraintClient = new HtmlOutputText();
                outputConstraintClient.setValue(Messages.getStringJSF("constraint.info.constraintClient"));
                panel.getChildren().add(outputConstraintClient);
                select = new HtmlSelectOneMenu();
                select.setId("constraintClient" + getItemUuid());
                UISelectItem item = new UISelectItem();
                item.setItemValue(null);
                item.setItemLabel(Messages.getStringJSF("constraint.constraintclient.all"));
                select.getChildren().add(item);
                for (ConstraintClient constraintClient : constraintClients) {
                    item = new UISelectItem();
                    item.setItemValue(constraintClient.getUuid());
                    item.setItemLabel(constraintClient.getDisplayName());
                    select.getChildren().add(item);
                }
                panel.getChildren().add(select);
            }
            HtmlOutputText empty = new HtmlOutputText();
View Full Code Here


    @Override
    public void renderView() {
        HtmlSelectManyListbox select = new HtmlSelectManyListbox();
        String[] valueArray = properties.getValues().split(";");
        for (int i = 0; i < valueArray.length; ++i) {
            UISelectItem item = new UISelectItem();
            item.setItemValue(valueArray[i]);
            item.setItemLabel(valueArray[i]);
            select.getChildren().add(item);
        }
        if (isDisabled()) {
            select.setDisabled(true);
        }
View Full Code Here

        LOG.debug("kid " + kid.getClass().getName());
      }
      if (kid instanceof UISelectItem) {
        Object value = ((UISelectItem) kid).getValue();
        if (value == null) {
          UISelectItem item = (UISelectItem) kid;
          if (kid instanceof org.apache.myfaces.tobago.component.UISelectItem) {
            list.add(new org.apache.myfaces.tobago.model.SelectItem(
                (org.apache.myfaces.tobago.component.UISelectItem) kid));
          } else {
            list.add(new SelectItem(item.getItemValue() == null ? "" : item.getItemValue(),
                item.getItemLabel() != null ? item.getItemLabel() : item.getItemValue().toString(),
                item.getItemDescription()));
          }
        } else if (value instanceof SelectItem) {
          list.add((SelectItem) value);
        } else {
          throw new IllegalArgumentException("TYPE ERROR: value NOT instanceof SelectItem. type="
View Full Code Here

        LOG.debug("kid " + kid.getClass().getName());
      }
      if (kid instanceof UISelectItem) {
        Object value = ((UISelectItem) kid).getValue();
        if (value == null) {
          UISelectItem item = (UISelectItem) kid;
          if (kid instanceof org.apache.myfaces.tobago.component.UISelectItem) {
            list.add(new org.apache.myfaces.tobago.model.SelectItem(
                (org.apache.myfaces.tobago.component.UISelectItem) kid));
          } else {
            list.add(new SelectItem(item.getItemValue() == null ? "" : item.getItemValue(),
                item.getItemLabel() != null ? item.getItemLabel() : item.getItemValue().toString(),
                item.getItemDescription()));
          }
        } else if (value instanceof SelectItem) {
          list.add((SelectItem) value);
        } else {
          throw new IllegalArgumentException("TYPE ERROR: value NOT instanceof SelectItem. type="
View Full Code Here

                    return false;
                }
            }
            if (child instanceof UISelectItem)
            {
                UISelectItem uiSelectItem = (UISelectItem) child;
                Object item = uiSelectItem.getValue();
                if (item == null)
                {
                    Object itemValue = ((UISelectItem) child).getItemValue();
                    String label = ((UISelectItem) child).getItemLabel();
                    String description = ((UISelectItem) child)
View Full Code Here

        LOG.debug("kid " + child.getClass().getName());
      }
      if (child instanceof UISelectItem) {
        final Object value = ((UISelectItem) child).getValue();
        if (value == null) {
          final UISelectItem item = (UISelectItem) child;
          if (child instanceof org.apache.myfaces.tobago.component.UISelectItem) {
            list.add(getSelectItem(
                (org.apache.myfaces.tobago.component.UISelectItem) child));
          } else {
            list.add(new SelectItem(item.getItemValue() == null ? "" : item.getItemValue(),
                item.getItemLabel() != null ? item.getItemLabel() : item.getItemValue().toString(),
                item.getItemDescription()));
          }
        } else if (value instanceof SelectItem) {
          list.add((SelectItem) value);
        } else {
          final String message
View Full Code Here

        LOG.debug("kid " + child.getClass().getName());
      }
      if (child instanceof UISelectItem) {
        final Object value = ((UISelectItem) child).getValue();
        if (value == null) {
          final UISelectItem item = (UISelectItem) child;
          if (child instanceof org.apache.myfaces.tobago.component.UISelectItem) {
            list.add(getSelectItem(
                (org.apache.myfaces.tobago.component.UISelectItem) child));
          } else {
            list.add(new SelectItem(item.getItemValue() == null ? "" : item.getItemValue(),
                item.getItemLabel() != null ? item.getItemLabel() : item.getItemValue().toString(),
                item.getItemDescription()));
          }
        } else if (value instanceof SelectItem) {
          list.add((SelectItem) value);
        } else {
          final String message
View Full Code Here

                    return false;
                }
            }
            if (child instanceof UISelectItem)
            {
                UISelectItem uiSelectItem = (UISelectItem) child;
                Object item = uiSelectItem.getValue();
                if (item == null)
                {
                    // no value attribute --> create the SelectItem out of the other attributes
                    Object itemValue = uiSelectItem.getItemValue();
                    String label = uiSelectItem.getItemLabel();
                    String description = uiSelectItem.getItemDescription();
                    boolean disabled = uiSelectItem.isItemDisabled();
                    boolean escape = uiSelectItem.isItemEscaped();
                    boolean noSelectionOption = uiSelectItem.isNoSelectionOption();
                    if (label == null)
                    {
                        label = itemValue.toString();
                    }
                    item = new SelectItem(itemValue, label, description, disabled, escape, noSelectionOption);
                }
                else if (!(item instanceof SelectItem))
                {
                    ValueExpression expression = uiSelectItem.getValueExpression("value");
                    throw new IllegalArgumentException("ValueExpression '"
                            + (expression == null ? null : expression.getExpressionString()) + "' of UISelectItem : "
                            + DebugUtils.getPathToComponent(child)
                            + " does not reference an Object of type SelectItem");
                }
View Full Code Here

                    return false;
                }
            }
            if (child instanceof UISelectItem)
            {
                UISelectItem uiSelectItem = (UISelectItem) child;
                Object item = uiSelectItem.getValue();
                if (item == null)
                {
                    Object itemValue = ((UISelectItem) child).getItemValue();
                    String label = ((UISelectItem) child).getItemLabel();
                    String description = ((UISelectItem) child)
View Full Code Here

            new HtmlRenderedAttr("styleClass", "styleClass", "class=\"styleClass\"", 1),
            //_TabindexProperty
            new HtmlRenderedAttr("tabindex")
        };
       
        UISelectItem item = new UISelectItem();
        item.setItemLabel("mars");
        item.setItemValue("mars");
        selectManyCheckbox.getChildren().add(item);

        HtmlCheckAttributesUtil.checkRenderedAttributes(
                selectManyCheckbox, facesContext, writer, attrs);
        if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) {
View Full Code Here

TOP

Related Classes of javax.faces.component.UISelectItem

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.