Calendar JSP taglib selection features
 Basics     Display     Titles     Fonts     Scrolling     Selection     Day Lists     Advanced Topics     
 
Automated selection of dates may be utilized to populate form fields or link to web content.

Selection Availability
Selection is defined and enabled through attributes of the <cal:click> tag. Automated selection functionality is enabled based on the name attribute value of 'selectDay' and the action attribute value is assigned the name attribute. Do not alter the action attribute for automated selection. The type attribute determines what occurs when a day is selected. Valid values for the type attribute include:
         •  select
    •  popup
    •  multi
    •  popupmulti
    •  link

When the link attribute is assigned, the type attribute defaults to 'link'. When the toField attribute is assigned, the type attribute defaults to 'select'.

Selection of Field Value
The selection of a date may be assigned to a specific form field. The targeted form field name is the value of the toField attribute. The format of the value should be in the format of FormName.FieldName (figure 1). The current form field value is replaced with the newly selected value, when the type attribute value is select or popup. When the type attribute value is multi or popupmulti, the current form field value is appended with the new selection.

Selection of Link
The selection of a date may display specific web content. Assign valid values to the link and/or target attributes. For details on valid values refer to the acceptable values for the href and target attributes for the HTML <a/> tag.

Selection Examples
Figure 1:
<form name=myForm>
     Start Date:
     <img src="images\popupCalendar.gif" border=0 align="top" height='18' style='{cursor:hand}' onClick="window.open('calSelectionPopup.jsp','startDate', 'width=400,height=200,toolbar=no,location=no,menubar=no');"/>
     <input type="text" name="startDate" size='10' />
     <cal:calendar>
          <cal:click name="scrollMonth"/>
          <cal:click name="selectDay" toField="myForm.startDate" />
     </cal:calendar>
</form>

-- Popup Window --
<cal:calendar>
     <cal:click name="selectDay" type='popup' toField="myForm.startDate"/>
</cal:calendar>

Figure 2:
<cal:calendar>
     <cal:click name="scrollMonth"/>
     <cal:click name="selectDay" target="_blank" link='http://www.ticketmaster.com/browse?type=range &area=Greater+Boston+Area &rdc_syear=$YYYY&rdc_smonth=$M&rdc_sday=$D &rdc_eyear=$YYYY&rdc_emonth=$M&rdc_eday=$D'/>
</cal:calendar>

 
Figure 1:
Start Date:
< May, 2004 >
Su Mo Tu We Th Fr Sa
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
Figure 2:
< Dec, 2010 >
Su Mo Tu We Th Fr Sa
28
29
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1