Package org.apache.myfaces.tobago.model

Examples of org.apache.myfaces.tobago.model.DateModel


    writer.startElement(HtmlElements.DIV, null);
    writer.writeClassAttribute(Classes.create(output, "row"));

    dateFormat = new SimpleDateFormat("E", locale);
    for (int dayIt = 0; dayIt < 7; ++dayIt) {
      DateModel date = model.getDate(0, dayIt);
      String dayName = dateFormat.format(date.getCalendar().getTime());
      dayName = StringUtils.substring(dayName, 0, 2);

      writer.startElement(HtmlElements.SPAN, null);
      writer.writeClassAttribute(Classes.create(output, "dayOfWeek"));
      writer.writeText(dayName);
      writer.endElement(HtmlElements.SPAN);
    }

    writer.endElement(HtmlElements.DIV);
    // end weeks

//    int weekCount = model.getWeekCount();
    for (int week = 0; week < 6; ++week) {
//    String style = (week < weekCount) ? "" : "style=\"display: none\"";
      writer.startElement(HtmlElements.DIV, null);
      writer.writeIdAttribute(id + ":" + week);
      writer.writeClassAttribute(Classes.create(output, "row"));
//      writer.writeAttribute(HtmlAttributes.STYLE, style, null);

      for (int dayIt = 0; dayIt < 7; ++dayIt) {
//      if (week < weekCount) {
        DateModel date = model.getDate(week, dayIt);
        String dayDescription = String.valueOf(date.getDay());
        String onclick = "selectDay('" + id + "', " + week + " , " + dayIt + ");";

        writer.startElement(HtmlElements.SPAN, null);
        writer.writeAttribute(HtmlAttributes.ONCLICK, onclick, true);
        writer.writeIdAttribute(id + ":" + week + ":" + dayIt);
        writer.writeClassAttribute(
            Classes.create(output, "day", date.getMonth() == model.getMonth() ? null : Markup.DISABLED));

        writer.writeText(dayDescription);

        writer.endElement(HtmlElements.SPAN);
View Full Code Here


    writer.startElement("tr", null);

    dateFormat = new SimpleDateFormat("E", locale);
    for (int dayIt = 0; dayIt < 7; ++dayIt) {
      DateModel date = model.getDate(0, dayIt);
      String dayName = dateFormat.format(date.getCalendar().getTime());
      dayName = StringUtils.substring(dayName, 0, 2);

      writer.startElement("th", null);
      writer.writeClassAttribute("tobago-calendar-inner-header");
      writer.writeText(dayName, null);
      writer.endElement("th");
    }

    writer.endElement("tr");

//    int weekCount = model.getWeekCount();
    for (int week = 0; week < 6; ++week) {
//    String style = (week < weekCount) ? "" : "style=\"display: none\"";
      writer.startElement("tr", null);
      writer.writeIdAttribute(id + ":" + week);
//      writer.writeAttribute("style", style, null);

      for (int dayIt = 0; dayIt < 7; ++dayIt) {
//      if (week < weekCount) {
        DateModel date = model.getDate(week, dayIt);
        String dayDescription = String.valueOf(date.getDay());
        String onclick = "selectDay('" + id + "', " + week + " , " + dayIt + ");";

        writer.startElement("td", null);
        writer.writeAttribute("onclick", onclick, null);
        writer.writeIdAttribute(id + ":" + week + ":" + dayIt);
View Full Code Here

    writer.startElement(HtmlConstants.TR, null);

    dateFormat = new SimpleDateFormat("E", locale);
    for (int dayIt = 0; dayIt < 7; ++dayIt) {
      DateModel date = model.getDate(0, dayIt);
      String dayName = dateFormat.format(date.getCalendar().getTime());
      dayName = StringUtils.substring(dayName, 0, 2);

      writer.startElement(HtmlConstants.TH, null);
      writer.writeClassAttribute("tobago-calendar-inner-header");
      writer.writeText(dayName);
      writer.endElement(HtmlConstants.TH);
    }

    writer.endElement(HtmlConstants.TR);

//    int weekCount = model.getWeekCount();
    for (int week = 0; week < 6; ++week) {
//    String style = (week < weekCount) ? "" : "style=\"display: none\"";
      writer.startElement(HtmlConstants.TR, null);
      writer.writeIdAttribute(id + ":" + week);
//      writer.writeAttribute(HtmlAttributes.STYLE, style, null);

      for (int dayIt = 0; dayIt < 7; ++dayIt) {
//      if (week < weekCount) {
        DateModel date = model.getDate(week, dayIt);
        String dayDescription = String.valueOf(date.getDay());
        String onclick = "selectDay('" + id + "', " + week + " , " + dayIt + ");";

        writer.startElement(HtmlConstants.TD, null);
        writer.writeAttribute(HtmlAttributes.ONCLICK, onclick, true);
        writer.writeIdAttribute(id + ":" + week + ":" + dayIt);
View Full Code Here

TOP

Related Classes of org.apache.myfaces.tobago.model.DateModel

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.