ICEfaces
  1. ICEfaces
  2. ICE-5477

Add support for highlighted and disabled dates to DateTimeEntry component

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 2.0-Alpha2
    • Fix Version/s: 3.0
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      JSF 2.0 + ICEfaces + YUI
    • Affects:
      Documentation (User Guide, Ref. Guide, etc.), Sample App./Tutorial

      Description

      For the new sparkle calendar component, we want to re-implement the ICEfaces 1.8.x selectInputDate feature of highlighted dates, but taking into account how the YUI calendar works, the improved style selectoring, and lessons learned from the old highlighting API, and add support for specific, non-recurring dates.

      ICE-5166 covers how to style recurring dates, using CSS selectors, so this jira will focus on highlighting and disabling specific dates.

      Yip has already wrapped the existing YUI properties minDate, maxDate, disabledDates, which are relevant to disabling:
          Disable any dates before February 8, 2010 as well as any dates after February 23, 2010
              minDate="2/8/2010"
              maxDate="2/23/2010"
          Disable Feb 10, 2010 as well as Feb 16 through Feb 18 2010 inclusive
              disabledDates="2/10/2010,2/16/2010-2/18/2010"

      For specific highlighted dates, one could assume anywhere from many dates, to very few dates. Possibly just around the current time-frame, or stretching back infinitely far into the past and into the future. So, a complete list of highlighted dates would not be feasible. In some way, the javascript code could query the component on the server, which could get highlighted dates from the bean. At first we discussed querying for every month, as the user navigated from month to month. That seemed to non-performant, and we didn't want to lose all of the benefit of the client-side nature of the new calendar. The idea of querying for a fixed block of time, say for 6 months, or a year, came up. That way clicking around adjacent months would remain client-side, until a boundary was reached, in which case the server would be queried. But that might not match the application's own data model. They might know date ranges for their own time range, and would have to go to the database beyond that, and then might have their own tuning parameter for how many months of highlighting data to retrieve. So, it was deemed best for the application to specify both the range of months for which it had highlighting data, as well as the actual highlighted dates, and their corresponding style classes.

      The properties on the calendar would be:

      String highlightedDisabledDateRange
      Eg: "1/2010-12/2010" depicts that we're specifying highlight and disabled info for Jan 2010 through Dec 2010, inclusive.

      Map<String date, String styleClasses> highlightedDatesStyles
      Date strings are specified as "12/31/2010" (month/day/year) and styleClasses are space delimited list of style classes. The Iterator must return the date and style class pairs in increasing date sequence.
      Note: Usage of LinkedHashMap(int initialCapacity, float loadFactor, boolean accessOrder=false) will provide a Map with the appropriate Iterator behaviour, if the dates are inserted in increasing sequence.

      As a convenience, perhaps we should augment the disabledDates property to be optionally specified as a Collection or Map of the "12/31/2010" (month/day/year) String objects, which we could just grab the Iterator from, and build the String that is a comma delimited list of dates, with dash delimited date ranges. For tuning purposes, if the Iterator returned the dates in sequence, then the resulting string may be more compact, and the javascript may execute faster.

        Activity

        Hide
        Ted Goddard added a comment -

        Since these text values will be passed into the component markup output, we must ensure that no output is allowed that could lead to cross-site scripting.

        Show
        Ted Goddard added a comment - Since these text values will be passed into the component markup output, we must ensure that no output is allowed that could lead to cross-site scripting.
        Hide
        Ken Fyten added a comment -

        Duplicate of ICE-6722.

        Show
        Ken Fyten added a comment - Duplicate of ICE-6722 .

          People

          • Assignee:
            Unassigned
            Reporter:
            Mark Collette
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: