Package org.richfaces.component

Examples of org.richfaces.component.UICalendar


  }

  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

          + onEventDefinition.toScript(), null);
    }
  }

  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

        UIOutputPanel panel = new UIOutputPanel();
        panel.setId("panel");
        panelgrid.getChildren().add(panel);
       
       
        UICalendar calendar = (UICalendar) facesContext.getApplication().createComponent(facesContext, "org.richfaces.component.UICalendar", "org.richfaces.renderkit.html.CalendarRenderer");

       
        //UICalendar calendar = new UICalendar();
        calendar.setValueExpression("value", expressionFactory.createValueExpression(elContext, "#{componentBindingCtrl.testDate}", Date.class));
        calendar.setEnableManualInput(true);
        calendar.setRequired(false);
        calendar.setId("cal");      
        calendar.setTimeZone(TimeZone.getDefault());
        calendar.setLocale(Locale.getDefault());
        panel.getChildren().add(calendar);        
    }
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

          + onEventDefinition.toScript(), null);
    }
  }

  public String getInputValue(FacesContext context, UIComponent component) {
    UICalendar input = (UICalendar) component;
    // XXX nick - nick - can contain either Date or String instance
    //Fix for myFaces 1.1.x RF-997
    Date value = null;
    try {
      value = input.getAsDate(input.getSubmittedValue());
    } catch (Exception e) {
      if (log.isDebugEnabled()) {
        log.debug(" InputValue: "
            + e.toString(), e);
      }
      value = null;   
    }
    Date curVal = input.getAsDate(input.getValue());

    DateTimeConverter converter = new DateTimeConverter();
    converter.setPattern(input.getDatePattern());
    Object locale = input.getLocale();
    converter.setLocale(input.getAsLocale(locale));
    converter.setTimeZone(input.getTimeZone());
    if (value == null) {
      return converter.getAsString(context, input, curVal);
    } else {
      return converter.getAsString(context, input, value);
    }
View Full Code Here

      String newValue = (String) submittedValue;
      // if we have no local value, try to get the valueExpression.
      ValueExpression valueExpression = component.getValueExpression("value");
      Converter converter = null;
     
      UICalendar calendar = (UICalendar) component;
      converter = calendar.getConverter();
     
      if ((converter == null) && (valueExpression != null)) {
    Class<? extends Object> converterType = valueExpression.getType(context.getELContext());
    if((converterType != null) && (converterType != Object.class)) {
        // if getType returns a type for which we support a default
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.