Magazine
 
JSF Tags: Tomahawk Tags
 
to input the date in the specified format. The current date can be displayed in the popup window in our required format with some string. Many attributes are there to use CSS in different parts of the component. In the following example, we can see how the component can be used in our page.

Code Description :

<%@ taglib uri=”http://java.sun.com/jsf/ html” prefix=”h”%> <%@ taglib uri=”http://java.sun.com/jsf/ core” prefix=”f”%>
<%@ taglib uri=”http:// myfaces.apache.org/tomahawk”
prefix=”t”%>
<f:view>
<t:document>
<t:documentHead>
<meta http-equiv=”Content-Type”
content=”text/html;
charset=iso-8859-1">
<title>t:inputCalendar example
</ title>
<style type=”text/css”>
<!—
.yearRowStyle {
background-color: #A8D1E8;
color: green;
text-align: center;
font-weight: bold;
font-style:italic;
}
.weekRowStyle {
background-color: #D6EBFC;
}
.selectedDayCellStyle {
background-color: #ECD5D2;
}
—>
</style>
</t:documentHead>
<t:documentBody ><center>
<h:form>
<t:inputCalendar

 

monthYearRowClass=”yearRowStyle”
weekRowClass=”weekRowStyle”
currentDayCellClass=
”selectedDayCellStyle”
value=”#{Calendar.selectedDate1}”/ >
<t:htmlTag value=”pre”>—
—</t:htmlTag>
<t:inputCalendar id=”secondOne” value=”#{Calendar.selectedDate2}” renderAsPopup=”true” popupDateFormat=
”MM/dd/yyyy”
popupTodayDateFormat= ”dd-MMM-yyyy”
popupWeekString=”Week” popupTodayString=
”The date today is :”
renderPopupButtonAsImage=”true”
popupButtonImageUrl=”images/cal.gif”
helpText=”MM/DD/YYYY” forceId=”true”/>
</h:form>
</center>
</t:documentBody>
</t:document>
</f:view>

Rendered Output :


Sept 2007 | Java Jazz Up | 17
 
previous
index
next
 
Pages: 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, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53 , 54, 55, 56, 57,

58
, 59, 60, 61, 62, 63 , 64, 65 , 66 , 67 , 68 , 69 , 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,   Download PDF