Author: pyaschenko
Date: 2008-01-30 11:09:49 -0500 (Wed, 30 Jan 2008)
New Revision: 5739
Modified:
trunk/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java
trunk/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp
trunk/ui/calendar/src/main/config/component/calendar.xml
trunk/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
Log:
RF-2026
Modified: trunk/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java
===================================================================
--- trunk/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java 2008-01-30
15:28:09 UTC (rev 5738)
+++ trunk/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java 2008-01-30
16:09:49 UTC (rev 5739)
@@ -55,6 +55,8 @@
private String direction;
private String boundary;
private String todayControlMode;
+ private boolean showHeader;
+ private boolean showFooter;
private int counter;
@@ -256,4 +258,20 @@
public void setTodayControlMode(String todayControlMode) {
this.todayControlMode = todayControlMode;
}
+
+ public boolean isShowHeader() {
+ return showHeader;
+ }
+
+ public void setShowHeader(boolean showHeader) {
+ this.showHeader = showHeader;
+ }
+
+ public boolean isShowFooter() {
+ return showFooter;
+ }
+
+ public void setShowFooter(boolean showFooter) {
+ this.showFooter = showFooter;
+ }
}
\ No newline at end of file
Modified: trunk/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp
===================================================================
--- trunk/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp 2008-01-30 15:28:09
UTC (rev 5738)
+++ trunk/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp 2008-01-30 16:09:49
UTC (rev 5739)
@@ -21,6 +21,11 @@
background-color: #0087FF;
}
</style>
+ <script>
+ var statusStart = 0;
+ var statusStop = 0;
+ var supportComplete = 0;
+ </script>
</head>
<body>
<f:view>
@@ -28,6 +33,7 @@
<h:messages showDetail="true" showSummary="true"/>
</a4j:outputPanel>
<h:form>
+ <a4j:commandLink value="Click"
oncomplete="alert('supportComplete: '+(++supportComplete));" />
<h:panelGroup id="counter">
<h:outputText value="#{calendarBean.counter}" />
</h:panelGroup>
@@ -59,6 +65,8 @@
boundaryDatesMode="#{calendarBean.boundary}"
currentDateChangeListener="#{calendarBean.dcl}"
valueChangeListener="#{calendarBean.ddd}"
+ showHeader="#{calendarBean.showHeader}"
+ showFooter="#{calendarBean.showFooter}"
reRender="counter"
inputClass="ic"
buttonClass="bc"
@@ -72,10 +80,7 @@
<f:facet name="optionalHeader">
<h:outputText value="optionalHeader Facet" />
</f:facet>
- <f:facet name="optionalFooter">
- <h:outputText value="optionalFooter Facet" />
- </f:facet>
-
+
<f:facet name="weekDay"><f:verbatim><span
style="padding: 2px; font-size: 10px"
>{weekDayLabelShort}</span></f:verbatim></f:facet>
<f:validator validatorId="org.richfaces.CalendarValidator" />
@@ -104,8 +109,13 @@
<h:selectBooleanCheckbox value="#{calendarBean.useCustomDayLabels}"
onclick="submit()"/>
<h:outputText value="Show Apply Button:" />
<h:selectBooleanCheckbox value="#{calendarBean.showApplyButton}"
onclick="submit()"/>
+ <h:outputText value="Show Header:" />
+ <h:selectBooleanCheckbox value="#{calendarBean.showHeader}"
onclick="submit()"/>
+ <h:outputText value="Show Footer:" />
+ <h:selectBooleanCheckbox value="#{calendarBean.showFooter}"
onclick="submit()"/>
<h:outputText value="Select Date Pattern:"/>
<h:selectOneMenu value="MMM d, yyyy" onchange="submit()"
valueChangeListener="#{calendarBean.selectPattern}">
+ <f:selectItem itemLabel="yyyyMMdd"
itemValue="yyyyMMdd"/>
<f:selectItem itemLabel="d/M/yy" itemValue="d/M/yy"/>
<f:selectItem itemLabel="dd/M/yy" itemValue="dd/M/yy"/>
<f:selectItem itemLabel="d/MMM/y" itemValue="d/MMM/y"/>
Modified: trunk/ui/calendar/src/main/config/component/calendar.xml
===================================================================
--- trunk/ui/calendar/src/main/config/component/calendar.xml 2008-01-30 15:28:09 UTC (rev
5738)
+++ trunk/ui/calendar/src/main/config/component/calendar.xml 2008-01-30 16:09:49 UTC (rev
5739)
@@ -510,14 +510,6 @@
<defaultvalue>true</defaultvalue>
</property>
<property>
- <name>showScrollerBar</name>
- <classname>boolean</classname>
- <description>
- If false this bar should not be shown
- </description>
- <defaultvalue>true</defaultvalue>
- </property>
- <property>
<name>todayControlMode</name>
<classname>java.lang.String</classname>
<description>
@@ -543,6 +535,22 @@
<classname>java.lang.String</classname>
<description>A localized user presentable name for this
component.</description>
</property>
+ <property>
+ <name>showHeader</name>
+ <classname>boolean</classname>
+ <description>
+ If false Calendar's header should not be shown
+ </description>
+ <defaultvalue>true</defaultvalue>
+ </property>
+ <property>
+ <name>showFooter</name>
+ <classname>boolean</classname>
+ <description>
+ If false Calendar's footer should not be shown
+ </description>
+ <defaultvalue>true</defaultvalue>
+ </property>
</component>
&listeners;
Modified: trunk/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java
===================================================================
--- trunk/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java 2008-01-30
15:28:09 UTC (rev 5738)
+++ trunk/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java 2008-01-30
16:09:49 UTC (rev 5739)
@@ -188,10 +188,14 @@
public abstract void setShowWeeksBar(boolean showWeeksBar);
- public abstract boolean isShowScrollerBar();
+ public abstract boolean isShowHeader();
- public abstract void setShowScrollerBar(boolean showScrollerBar);
+ public abstract void setShowHeader(boolean showScrollerBar);
+ public abstract boolean isShowFooter();
+
+ public abstract void setShowFooter(boolean showScrollerBar);
+
public abstract String getTodayControlMode();
public abstract void setTodayControlMode(String todayControlMode);
Modified:
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
===================================================================
---
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2008-01-30
15:28:09 UTC (rev 5738)
+++
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2008-01-30
16:09:49 UTC (rev 5739)
@@ -132,7 +132,6 @@
els.display = originalDisplay;
els.position = originalPosition;
els.visibility = originalVisibility;
-
element.style.left = (ox + windowRect.left) + 'px';
element.style.top = (oy + windowRect.top) + 'px';
};
@@ -501,7 +500,6 @@
Calendar = Class.create();
Object.extend(Calendar.prototype, {
initialize: function(id,parameters) {
-
// dayListTableId, weekNumberBarId, weekDayBarId - 3 tables ids',
// dayListMarkup - day cell markup
@@ -525,6 +523,8 @@
// showWeekDaysBar - show WeekDays Bar [default value is true]
// showWeeksBar - show Weeks numbers bar [default value is true]
// showApplyButton
+ // showHeader
+ // showFooter
// POPUP description
// direction - [top-left, top-right, bottom-left, bottom-right, auto]
@@ -550,7 +550,7 @@
// className - table class
//var _d = new Date();
-
+
this.id = id;
this.params = parameters;
@@ -640,8 +640,8 @@
var colspan = (this.params.showWeeksBar ? "8" : "7");
var htmlHeaderOptional = (this.params.optionalHeaderMarkup) ? '<tr><td
class="rich-calendar-header-optional" colspan="'+colspan+'"
id="'+this.id+'HeaderOptional"></td></tr>' :
'';
var htmlFooterOptional = (this.params.optionalFooterMarkup) ? '<tr><td
class="rich-calendar-footer-optional" colspan="'+colspan+'"
id="'+this.id+'FooterOptional"></td></tr>' :
'';
- var htmlControlsHeader = '<tr><td class="rich-calendar-header"
colspan="'+colspan+'"
id="'+this.id+'Header"></td></tr>';
- var htmlControlsFooter = '<tr><td class="rich-calendar-footer"
colspan="'+colspan+'"
id="'+this.id+'Footer"></td></tr>';
+ var htmlControlsHeader = (this.params.showHeader ? '<tr><td
class="rich-calendar-header" colspan="'+colspan+'"
id="'+this.id+'Header"></td></tr>' : '');
+ var htmlControlsFooter = (this.params.showFooter ? '<tr><td
class="rich-calendar-footer" colspan="'+colspan+'"
id="'+this.id+'Footer"></td></tr>' : '');
var htmlTextFooter = '</tbody></table>\n'
var htmlTextIFrame = '<iframe src="javascript:\'\'"
frameborder="0" scrolling="no" id="' + this.IFRAME_ID +
'" style="display:none; position: absolute; width: 1px; height: 1px;
background-color:white;">'+'</iframe>\n';
@@ -1053,6 +1053,7 @@
},
doCollapse: function() {
+
if (!this.params.popup || !this.isVisible) return;
if (this.isEditorVisible) this.hideEditor();
@@ -1127,7 +1128,6 @@
iframe.style.height = edim.height+'px';
Element.show(iframe);
}
-
Element.show(element);
this.isVisible = true;
@@ -1591,8 +1591,8 @@
renderHF: function()
{
- this.renderMarkup(this.params.headerMarkup, this.id+"Header",
this.calendarContext);
- this.renderMarkup(this.params.footerMarkup, this.id+"Footer",
this.calendarContext);
+ if (this.params.showHeader) this.renderMarkup(this.params.headerMarkup,
this.id+"Header", this.calendarContext);
+ if (this.params.showFooter) this.renderMarkup(this.params.footerMarkup,
this.id+"Footer", this.calendarContext);
},
renderHeaderOptional: function()
Modified: trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
===================================================================
--- trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2008-01-30
15:28:09 UTC (rev 5738)
+++ trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2008-01-30
16:09:49 UTC (rev 5739)
@@ -184,7 +184,8 @@
firstWeekDay: #{this:getFirstWeekDay(context, component)},
minDaysInFirstWeek: #{this:getMinDaysInFirstWeek(context, component)},
todayControlMode:'#{component.attributes["todayControlMode"]}',
- showScrollerBar:#{component.attributes['showScrollerBar']},
+ showHeader:#{component.attributes['showHeader']},
+ showFooter:#{component.attributes['showFooter']},
showWeeksBar:#{component.attributes['showWeeksBar']},
showWeekDaysBar:#{component.attributes['showWeekDaysBar']},
showApplyButton:#{component.attributes['showApplyButton']}