DateTimeEntry Year Range

Table of Contents

DateTimeEntry Year Range

When you navigate the years by a drop down list (i.e. navigator="true"), you can control the range of years displayed by using the yearRange attribute. The syntax for speicifying the year range is as follows:

-nn:+nn    years relative to today's year, e.g. -5:+5
c-nn:c+nn  years relative to selected date's year, e.g c-5:c+5
nnnn:nnnn  specific years, e.g. 2008:2018

Or combinations of above formats, e.g. 2003:+5

Example markup:

            <h:selectOneRadio id="yearRange" value="#{dateTimeEntryBean.yearRange}">
                <f:ajax execute="@this" render="@all"/>
                <f:selectItem itemLabel="-5:+5" itemValue="-5:+5"/>
                <f:selectItem itemLabel="c-5:c+5" itemValue="c-5:c+5"/>
                <f:selectItem itemLabel="2008:2018" itemValue="2008:2018"/>
                <f:selectItem itemLabel="2003:+5" itemValue="2003:+5"/>
            <ace:dateTimeEntry id="yearRangeCal" navigator="true" value="#{dateTimeEntryBean.selectedDate}" yearRange="#{dateTimeEntryBean.yearRange}"/>

For a current year of 2012 and a selected year of 2010, the ranges will respectively be: 2007-2017, 2005-2015, 2008-2018 and 2003-2017. The default is c-10:c+10.

Tutorial Source Code Downloads

Example Source Notes
dateTimeEntry-yearRange dateTimeEntry-yearRange source code Simple example of how to set up a year range.

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

© Copyright 2018 ICEsoft Technologies Canada Corp.