Package org.richfaces.component

Examples of org.richfaces.component.UICalendar


    if (currentValue != null) {
        return currentValue.toString();
    }
    return null;
      }
      UICalendar calendar = (UICalendar) component;
     
      // if value is null and no converter attribute is specified, then
      // return a zero length String.
      if(currentValue == null) {
    return "";
      }
     
      if (converter == null) {
    // If there is a converter attribute, use it to to ask application
    // instance for a converter with this identifier.
    converter = calendar.getConverter();
      }
     
      if (converter == null) {
    // Do not look for "by-type" converters for Strings
    if (currentValue instanceof String) {
View Full Code Here


      throws IOException {

  }

  public JSReference getIsDayEnabled(FacesContext context, UIComponent component) {
    UICalendar calendar = (UICalendar) component;
    String isDayEnabled = (String) calendar.getAttributes().get(
        "isDayEnabled");
    if (isDayEnabled != null && isDayEnabled.length() != 0) {
      return new JSReference(isDayEnabled); //new JSFunction(isDayEnabled);
    }
   
View Full Code Here

   
    return null;
  }
 
  public JSReference getDayStyleClass(FacesContext context, UIComponent component) {
    UICalendar calendar = (UICalendar) component;
    String dayStyleClass = (String) calendar.getAttributes().get(
        "dayStyleClass");
    if (dayStyleClass != null && dayStyleClass.length() != 0) {
      return new JSReference(dayStyleClass);
    }
   
View Full Code Here

    definition.addToBody(ajaxFunction);
    return definition;
  }

  public String getInputValue(FacesContext context, UIComponent component) {
    UICalendar calendar = (UICalendar) component;
    // Fix for myFaces 1.1.x RF-997
    String returnValue = null;
    Object value = calendar.getSubmittedValue();
    if (value != null) {
        try {
      returnValue =  getFormattedValue(context, calendar, value);
        } catch (Exception e) {
      if (log.isDebugEnabled()) {
          log.debug(" InputValue: " + e.toString(), e);
      }
      returnValue = (String)value;
        }
          } else {
              returnValue =  getFormattedValue(context, calendar, calendar.getValue())
          }
   
    return returnValue;
  }
View Full Code Here

    if (submittedValue instanceof Date) {
      return (Date) submittedValue;
    }

    DateTimeConverter converter = new DateTimeConverter();
    UICalendar calendar = (UICalendar) component;
    converter.setPattern(calendar.getDatePattern());
    converter.setLocale(calendar.getLocale());
    converter.setTimeZone(calendar.getTimeZone());
    return converter.getAsObject(context, component,
        (String) submittedValue);
  }
View Full Code Here

      writer.writeText(",\n" + eventName + ": "+onEventDefinition.toScript(), null);
    }
  }

  public String getInputValue(FacesContext context, UIComponent component) {
    UICalendar input = (UICalendar) component;
    // XXX nick - nick - can contain either Date or String instance

    Object value = input.getSubmittedValue();
    Object curVal = input.getValue();
    if (value == null) {

      DateTimeConverter converter = new DateTimeConverter();
      converter.setPattern(input.getDatePattern());
      converter.setLocale(input.getLocale());
      converter.setTimeZone(input.getTimeZone());
      return converter.getAsString(context, input, curVal);
    }
    if (value instanceof Date) {

      DateTimeConverter converter = new DateTimeConverter();
      converter.setPattern(input.getDatePattern());
      converter.setLocale(input.getLocale());
      return converter.getAsString(context, input, value);
    }
    if (value instanceof String) {

      Converter converter = SelectUtils.getConverterForProperty(context,
View Full Code Here

      UIComponent component, Object submittedValue)
      throws ConverterException {
    if (submittedValue instanceof Date) {
      return (Date) submittedValue;
    }
    UICalendar calendar = (UICalendar) component;
    if (calendar.getConverter() != null) {

      return calendar.getConverter().getAsObject(context, component,
          (String) submittedValue);

    } else {
      DateTimeConverter converter = new DateTimeConverter();
      converter.setPattern(calendar.getDatePattern());
      converter.setLocale(calendar.getAsLocale(calendar.getLocale()));
      converter.setTimeZone(calendar.getTimeZone());
      return converter.getAsObject(context, component,
          (String) submittedValue);
    }
  }
View Full Code Here

  }

  public void writeClass(FacesContext context, UIComponent component)
      throws IOException {

    UICalendar calendar = (UICalendar) component;
    String styleClass = (String) calendar.getAttributes().get("styleClass");
    if (styleClass != null && styleClass.length() != 0) {
      ResponseWriter writer = context.getResponseWriter();
      writer.writeText(",\n className: '" + styleClass+"'", null);
    }
  }
View Full Code Here

  }

  public void writeDayStyleClass(FacesContext context, UIComponent component)
      throws IOException {

    UICalendar calendar = (UICalendar) component;
    String dayStyleClass = (String) calendar.getAttributes().get(
        "dayStyleClass");
    if (dayStyleClass != null && dayStyleClass.length() != 0) {
      ResponseWriter writer = context.getResponseWriter();
      writer.writeText(",\n dayStyleClass: " + dayStyleClass, null);
    }
View Full Code Here

  }

  public void writeIsDayEnabled(FacesContext context, UIComponent component)
      throws IOException {
    UICalendar calendar = (UICalendar) component;
    String isDayEnabled = (String) calendar.getAttributes().get(
        "isDayEnabled");
    if (isDayEnabled != null && isDayEnabled.length() != 0) {
      ResponseWriter writer = context.getResponseWriter();
      writer.writeText(",\n isDayEnabled: " + isDayEnabled, null);
    }
View Full Code Here

TOP

Related Classes of org.richfaces.component.UICalendar

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.