Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Adding Calender Control

 
komal ekbote
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ranchers,
Can anybody please tell me how to use Calendar Control using the MyFaces Tomahawk?
 
mano ranjan
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Use <t:inputCalendar renderAsPopup="true">

thanks
 
komal ekbote
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thankyou mano,

Got it...Is there any way through which we can change the default image displayed for the popup calender.
 
mano ranjan
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
It can be done by applying css for a particular row or row.check the attributes available for input calender.

thanks
mano
 
komal ekbote
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have tried with the following code to CSS with the popup Calendar..
But any how the CSS is not being applied to the Calendar.

Can Anyone please help.




<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>First page</title>
</head>
<body>
<h2> Example for Calendar Control</h2>
<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 id="addMFForm">
<hutputText id="out" value="DATE::" />

<t:inputCalendar id="cal"
renderAsPopup ="true"
popupButtonStyle ="true"
popupButtonStyleClass="true"

monthYearRowClass="yearRowStyle"
weekRowClass="weekRowStyle"
currentDayCellClass="selectedDayCellStyle"

renderPopupButtonAsImage ="true"
popupButtonImageUrl ="Images/calendar.gif"

helpText="MM/DD/YYYY" />
</h:form></center>
</t:documentBody>
</t:document>

</f:view>
</body>
</html>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic