Package javax.faces.component

Examples of javax.faces.component.UISelectBoolean



    protected void setProperties(UIComponent component) {
        super.setProperties(component);

        UISelectBoolean select;
        try {
            select = (UISelectBoolean) component;
        } catch (ClassCastException cce) {
            throw new FacesException("Tag <" + getClass().getName() + "> expected UISelectBoolean. " +
                                     "Got <" + component.getClass().getName() + ">");
        }

        if (converter != null) {
            if (FacesUtils.isExpression(converter)) {
                select.setValueBinding("converter", createValueBinding(converter));
            } else {
                select.setConverter(getApplication().createConverter(converter));
            }
        }

        if (immediate != null) {
            if (FacesUtils.isExpression(immediate)) {
                select.setValueBinding("immediate", createValueBinding(immediate));
            } else {
                select.setImmediate(BooleanUtils.toBoolean(immediate));
            }
        }

        if (required != null) {
            if (FacesUtils.isExpression(required)) {
                select.setValueBinding("required", createValueBinding(required));
            } else {
                select.setRequired(BooleanUtils.toBoolean(required));
            }
        }

        if (validator != null) {
            if (FacesUtils.isExpression(validator)) {
                MethodBinding vb = getApplication().createMethodBinding(validator,
                                                                        new Class[]{ FacesContext.class, UIComponent.class, Object.class });
                select.setValidator(vb);
            } else {
                throw new FacesException("Tag <" + getClass().getName() + "> validator must be an expression. " +
                                         "Got <" + validator + ">");
            }
        }

        if (value != null) {
            if (FacesUtils.isExpression(value)) {
                select.setValueBinding("value", createValueBinding(value));
            } else {
                select.setValue(value);
            }
        }

        if (valueChangeListener != null) {
            if (FacesUtils.isExpression(valueChangeListener)) {
                MethodBinding vb = getApplication().createMethodBinding(valueChangeListener,
                                                                        new Class[]{ ValueChangeEvent.class });
                select.setValueChangeListener(vb);
            } else {
                throw new FacesException("Tag <" + getClass().getName() + "> valueChangeListener must be an expression. " +
                                         "Got <" + valueChangeListener + ">");
            }
        }
View Full Code Here



    protected void setProperties(UIComponent component) {
        super.setProperties(component);

        UISelectBoolean select;
        try {
            select = (UISelectBoolean) component;
        } catch (ClassCastException cce) {
            throw new FacesException("Tag <" + getClass().getName() + "> expected UISelectBoolean. " +
                                     "Got <" + component.getClass().getName() + ">");
        }

        if (converter != null) {
            if (FacesUtils.isExpression(converter)) {
                select.setValueBinding("converter", createValueBinding(converter));
            } else {
                select.setConverter(getApplication().createConverter(converter));
            }
        }

        if (immediate != null) {
            if (FacesUtils.isExpression(immediate)) {
                select.setValueBinding("immediate", createValueBinding(immediate));
            } else {
                select.setImmediate(BooleanUtils.toBoolean(immediate));
            }
        }

        if (required != null) {
            if (FacesUtils.isExpression(required)) {
                select.setValueBinding("required", createValueBinding(required));
            } else {
                select.setRequired(BooleanUtils.toBoolean(required));
            }
        }

        if (validator != null) {
            if (FacesUtils.isExpression(validator)) {
                MethodBinding vb = getApplication().createMethodBinding(validator,
                                                                        new Class[]{ FacesContext.class, UIComponent.class, Object.class });
                select.setValidator(vb);
            } else {
                throw new FacesException("Tag <" + getClass().getName() + "> validator must be an expression. " +
                                         "Got <" + validator + ">");
            }
        }

        if (value != null) {
            if (FacesUtils.isExpression(value)) {
                select.setValueBinding("value", createValueBinding(value));
            } else {
                select.setValue(value);
            }
        }

        if (valueChangeListener != null) {
            if (FacesUtils.isExpression(valueChangeListener)) {
                MethodBinding vb = getApplication().createMethodBinding(valueChangeListener,
                                                                        new Class[]{ ValueChangeEvent.class });
                select.setValueChangeListener(vb);
            } else {
                throw new FacesException("Tag <" + getClass().getName() + "> valueChangeListener must be an expression. " +
                                         "Got <" + valueChangeListener + ">");
            }
        }
View Full Code Here

  }

  public void encodeEndTobago(FacesContext facesContext,
      UIComponent uiComponent) throws IOException {

    UISelectBoolean component = (UISelectBoolean) uiComponent;

    TobagoResponseWriter writer
        = (TobagoResponseWriter) facesContext.getResponseWriter();

    UIComponent label = ComponentUtil.provideLabel(facesContext, component);

    boolean inline = ComponentUtil.getBooleanAttribute(component, ATTR_INLINE);

    if (label != null && !inline) {

      writer.startElement("table", component);
      writer.writeAttribute("border", "0", null);
      writer.writeAttribute("cellspacing", "0", null);
      writer.writeAttribute("cellpadding", "0", null);
      writer.writeAttribute("summary", "", null);
      writer.writeAttribute("title", null, ATTR_TIP);

      writer.startElement("tr", null);
      writer.startElement("td", null);
    }

    Boolean currentValue = (Boolean) component.getValue();
    boolean checked = currentValue != null && currentValue.booleanValue();

    writer.startElement("input", component);
    writer.writeAttribute("type", "checkbox", null);
    writer.writeAttribute("value", "true", null);
    writer.writeAttribute("checked", checked);
    writer.writeNameAttribute(component.getClientId(facesContext));
    writer.writeComponentClass();
    writer.writeIdAttribute(component.getClientId(facesContext));
    writer.writeAttribute("disabled",
        ComponentUtil.getBooleanAttribute(component, ATTR_DISABLED));
    writer.writeAttribute("title", null, ATTR_TIP);
    writer.endElement("input");
View Full Code Here

  boolean bIsOptional = getObligation().equalsIgnoreCase(Section.OBLIGATION_OPTIONAL);
 
  setOpen(true);
  UIComponent component = editorForm.findComponent(sCheckboxId);
  if ((component != null) && (component instanceof UISelectBoolean)) {
    UISelectBoolean checkbox = (UISelectBoolean)component;
    checkbox.setSelected(getOpen());
  }
  if (!bIsExclusive && !bIsOptional) {
    component = editorForm.findComponent(sImgId);
    if ((component != null) && (component instanceof UIGraphic)) {
      setGraphicUrl((UIGraphic)component);
View Full Code Here

      }
    }
  } else {
    component = editorForm.findComponent(sCheckboxId);
    if ((component != null) && (component instanceof UISelectBoolean)) {
      UISelectBoolean checkbox = (UISelectBoolean)component;
      setOpen(checkbox.isSelected());
    }
  }
 
  // set the graphic for regular sections upon the open status
  if (!bIsExclusive && !bIsOptional) {
View Full Code Here

    String sFKey = sKey.replace('.','_');
    sFKey = sKey.replace(':','_');
    String sId  = sIdPfx+"-"+sFKey;
    UIComponent component = editorForm.findComponent(sId);
    if ((component != null) && (component instanceof UISelectBoolean)) {
      UISelectBoolean checkBox = (UISelectBoolean)component;
     
      // add the code key to the parameter's multiple values if selected
      if (checkBox.isSelected() && (sKey.length() > 0)) {
        values.add(new ContentValue(sKey));
      }
    }
  }
}
View Full Code Here

TOP

Related Classes of javax.faces.component.UISelectBoolean

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.