[richfaces-svn-commits] JBoss Rich Faces SVN: r13668 - in trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar: examples and 1 other directory.
richfaces-svn-commits at lists.jboss.org
richfaces-svn-commits at lists.jboss.org
Fri Apr 17 18:58:53 EDT 2009
Author: ilya_shaikovsky
Date: 2009-04-17 18:58:53 -0400 (Fri, 17 Apr 2009)
New Revision: 13668
Added:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/clientFunctions.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/examples/functions.xhtml
Log:
calendar sample of client side styling disablement added.(TDB description)
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/clientFunctions.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/clientFunctions.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/clientFunctions.xhtml 2009-04-17 22:58:53 UTC (rev 13668)
@@ -0,0 +1,26 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+<ui:composition template="/templates/component-sample.xhtml">
+ <ui:define name="sample">
+ <p>
+ This simple example shows the way of dates disablement and styling without dataModel usage.
+ </p>
+ <fieldset class="demo_fieldset">
+ <legend class="demo_legend">Calendar Demo</legend>
+ <div class="sample-container" >
+ <ui:include src="/richfaces/calendar/examples/functions.xhtml"/>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="openlabel" value="View Source" />
+ <ui:param name="sourcepath" value="/richfaces/calendar/examples/functions.xhtml"/>
+ </ui:include>
+ </div>
+ </fieldset>
+ </ui:define>
+
+</ui:composition>
+</html>
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/examples/functions.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/examples/functions.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/examples/functions.xhtml 2009-04-17 22:58:53 UTC (rev 13668)
@@ -0,0 +1,36 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+ <style>
+ .everyThirdDay{
+ background-color:gray;
+
+ }
+ .weekendBold{
+ font-weight:bold;
+ }
+
+ </style>
+ <script type="text/javascript">
+ var curDt = new Date();
+ function disablementFunction(day){
+ if (day.isWeekend) return false;
+ if (curDt==undefined){
+ curDt = day.date.getDate;
+ }
+ if (curDt.getTime() - day.date.getTime() < 0) return true; else return false;
+ }
+ function disabledClassesProv(day){
+ if (curDt.getTime() - day.date.getTime() >= 0) return 'rich-calendar-boundary-dates';
+ var res = '';
+ if (day.isWeekend) res+='weekendBold ';
+ if (day.day%3==0) res+='everyThirdDay';
+ return res;
+ }
+ </script>
+ <rich:calendar isDayEnabled="disablementFunction" dayStyleClass="disabledClassesProv" boundaryDatesMode="scroll"/>
+
+</ui:composition>
\ No newline at end of file
More information about the richfaces-svn-commits
mailing list