Author: pyaschenko
Date: 2007-12-07 14:14:42 -0500 (Fri, 07 Dec 2007)
New Revision: 4609
Modified:
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.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-1551
Modified:
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
---
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2007-12-07
19:12:16 UTC (rev 4608)
+++
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2007-12-07
19:14:42 UTC (rev 4609)
@@ -95,6 +95,9 @@
ajaxContext.getAjaxRenderedAreas().add(
clientId + "IFrame");
+
+ ajaxContext.getAjaxRenderedAreas().add(
+ clientId + "Script");
}
}
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 2007-12-07
19:12:16 UTC (rev 4608)
+++
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-12-07
19:14:42 UTC (rev 4609)
@@ -568,7 +568,7 @@
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 htmlTextFooter = '</tbody></table>\n'
- var htmlTextIFrame = '';
+ 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';
// days bar creation
var styleClass;
@@ -625,34 +625,34 @@
htmlTextWeek+='</tr>';
}
- //obj.innerHTML =
htmlTextIFrame+htmlTextHeader+htmlHeaderOptional+htmlControlsHeader+htmlTextWeekDayBar+htmlTextWeek+htmlControlsFooter+htmlFooterOptional+htmlTextFooter;
var span=$(this.POPUP_ID);
- if (this.params.popup/* && Richfaces.browser.isIE6*/) {
- for (var container = span.nextSibling; container; ) {
- if (container.id == this.IFRAME_ID) {
- Element.replace(container,
- '<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');
-
+ var obj = span.nextSibling;
+ if (this.params.popup && Richfaces.browser.isIE6)
+ {
+ do {
+ if (obj.id == this.IFRAME_ID)
+ {
+ var iframe = obj;
+ obj = obj.nextSibling;
+ Element.replace(iframe, htmlTextIFrame);
break;
}
-
- container = container.nextSibling
- }
+ } while (obj = obj.nextSibling);
}
- for (var container = span.nextSibling; container; ) {
- if (container.id == id) {
- Element.replace(container,
- htmlTextIFrame+htmlTextHeader+htmlHeaderOptional+htmlControlsHeader+htmlTextWeekDayBar+htmlTextWeek+htmlControlsFooter+htmlFooterOptional+htmlTextFooter);
+ do {
+ if (obj.id == id)
+ {
+ var div = obj;
+ obj = obj.previousSibling;
+ Element.replace(div,
htmlTextHeader+htmlHeaderOptional+htmlControlsHeader+htmlTextWeekDayBar+htmlTextWeek+htmlControlsFooter+htmlFooterOptional+htmlTextFooter);
break;
}
-
- container = container.nextSibling;
- }
+ } while (obj = obj.nextSibling);
// set content
- var obj=$(id);
+ var obj=obj.nextSibling;
obj.component = this;
obj.richfacesComponent="richfaces:calendar";
@@ -1333,13 +1333,12 @@
this.selectedDateCellId = this.clearEffect(this.selectedDateCellId,
this.highlightEffect2, "rich-calendar-select");
//var _d=new Date();
-
+ var obj = $(this.params.weekNumberBarId+"1");
for (var k=1;k<7;k++)
{
//
dataobj = this.days[p];
- var obj = $(this.params.weekNumberBarId+k);
element = obj.firstChild;
var weeknumber;
@@ -1440,6 +1439,7 @@
dataobj = this.days[p];
element=element.nextSibling;
}
+ obj = obj.nextSibling;
}
//alert(new Date().getTime()-_d.getTime());
Modified: trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
===================================================================
--- trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-12-07
19:12:16 UTC (rev 4608)
+++ trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-12-07
19:14:42 UTC (rev 4609)
@@ -143,90 +143,91 @@
style="display:none"
name="#{clientId}InputCurrentDate"
value="#{this:getCurrentDateAsString(context,component,currentDate)}"
type="hidden" />
-
+ <f:call name="dayCellClass" />
</span>
<div style="display: none;"
id="#{clientId}IFrame"></div>
<div style="display: none;" id="#{clientId}">
- <f:call name="dayCellClass" />
- <script type="text/javascript">
- new Calendar('#{clientId}', {
+ </div>
+ <div style="display: none;" id="#{clientId}Script">
+ <script type="text/javascript">
+ new Calendar('#{clientId}', {
+
+ <jsp:scriptlet>/*<![CDATA[*/
+ String mode = (String) component.getAttributes().get("mode");
+ if(org.richfaces.component.UICalendar.AJAX_MODE.equals(mode)){
+ /*]]>*/</jsp:scriptlet>
- <jsp:scriptlet>/*<![CDATA[*/
- String mode = (String) component.getAttributes().get("mode");
- if(org.richfaces.component.UICalendar.AJAX_MODE.equals(mode)){
- /*]]>*/</jsp:scriptlet>
-
- submitFunction: <jsp:scriptlet>/*<![CDATA[*/writeSubmitFunction(context,
component);/*]]>*/</jsp:scriptlet>,
-
- <jsp:scriptlet>/*<![CDATA[*/
- }
- /*]]>*/</jsp:scriptlet>
+ submitFunction: <jsp:scriptlet>/*<![CDATA[*/writeSubmitFunction(context,
component);/*]]>*/</jsp:scriptlet>,
- dayListTableId: '#{clientId}Day',
- weekNumberBarId: '#{clientId}WeekNum',
- weekDayBarId: '#{clientId}WeekDay',
- currentDate: #{this:getCurrentDate(context, component, currentDate)},
- selectedDate: #{this:getSelectedDate(context, component)},
- datePattern: '#{component.datePattern}',
- jointPoint: '#{component.jointPoint}',
- direction: '#{component.direction}',
- toolTipMode:'#{component.toolTipMode}',
- boundaryDatesMode:'#{component.boundaryDatesMode}',
- popup: #{component.popup},
- enableManualInput: #{component.attributes['enableManualInput']},
- showInput: #{component.attributes['showInput']},
- disabled: #{component.disabled},
- ajaxSingle: #{component.attributes['ajaxSingle']},
- verticalOffset:#{component.verticalOffset},
- horizontalOffset: #{component.horizontalOffset},
- style:'z-index: #{component.attributes["zindex"]};
#{component.attributes["style"]}',
- firstWeekDay: #{this:getFirstWeekDay(context, component)},
- minDaysInFirstWeek: #{this:getMinDaysInFirstWeek(context, component)},
- todayControlMode:'#{component.attributes["todayControlMode"]}',
- showScrollerBar:#{component.attributes['showScrollerBar']},
- showWeeksBar:#{component.attributes['showWeeksBar']},
- showWeekDaysBar:#{component.attributes['showWeekDaysBar']},
- showApplyButton:#{component.attributes['showApplyButton']}
-
-
-
- <f:call name="writeClass"/>
- <f:call name="writeDayCellClass"/>
- <f:call name="writeDayStyleClass"/>
- <f:call name="writeIsDayEnabled"/>
- <f:call name="writeSymbols" />
-
-
- <f:call name="writeEventHandlerFunction"><f:parameter
value="ondateselected" /></f:call>
- <f:call name="writeEventHandlerFunction"><f:parameter
value="ondateselect" /></f:call>
- <f:call name="writeEventHandlerFunction"><f:parameter
value="ondatemouseover" /></f:call>
- <f:call name="writeEventHandlerFunction"><f:parameter
value="ondatemouseout" /></f:call>
- <f:call name="writeEventHandlerFunction"><f:parameter
value="onexpand" /></f:call>
- <f:call name="writeEventHandlerFunction"><f:parameter
value="oncollapse" /></f:call>
- <f:call name="writeEventHandlerFunction"><f:parameter
value="oncurrentdateselect" /></f:call>
+ <jsp:scriptlet>/*<![CDATA[*/
+ }
+ /*]]>*/</jsp:scriptlet>
+
+ dayListTableId: '#{clientId}Day',
+ weekNumberBarId: '#{clientId}WeekNum',
+ weekDayBarId: '#{clientId}WeekDay',
+ currentDate: #{this:getCurrentDate(context, component, currentDate)},
+ selectedDate: #{this:getSelectedDate(context, component)},
+ datePattern: '#{component.datePattern}',
+ jointPoint: '#{component.jointPoint}',
+ direction: '#{component.direction}',
+ toolTipMode:'#{component.toolTipMode}',
+ boundaryDatesMode:'#{component.boundaryDatesMode}',
+ popup: #{component.popup},
+ enableManualInput: #{component.attributes['enableManualInput']},
+ showInput: #{component.attributes['showInput']},
+ disabled: #{component.disabled},
+ ajaxSingle: #{component.attributes['ajaxSingle']},
+ verticalOffset:#{component.verticalOffset},
+ horizontalOffset: #{component.horizontalOffset},
+ style:'z-index: #{component.attributes["zindex"]};
#{component.attributes["style"]}',
+ firstWeekDay: #{this:getFirstWeekDay(context, component)},
+ minDaysInFirstWeek: #{this:getMinDaysInFirstWeek(context, component)},
+ todayControlMode:'#{component.attributes["todayControlMode"]}',
+ showScrollerBar:#{component.attributes['showScrollerBar']},
+ showWeeksBar:#{component.attributes['showWeeksBar']},
+ showWeekDaysBar:#{component.attributes['showWeekDaysBar']},
+ showApplyButton:#{component.attributes['showApplyButton']}
+
+
+
+ <f:call name="writeClass"/>
+ <f:call name="writeDayCellClass"/>
+ <f:call name="writeDayStyleClass"/>
+ <f:call name="writeIsDayEnabled"/>
+ <f:call name="writeSymbols" />
+
+
+ <f:call name="writeEventHandlerFunction"><f:parameter
value="ondateselected" /></f:call>
+ <f:call name="writeEventHandlerFunction"><f:parameter
value="ondateselect" /></f:call>
+ <f:call name="writeEventHandlerFunction"><f:parameter
value="ondatemouseover" /></f:call>
+ <f:call name="writeEventHandlerFunction"><f:parameter
value="ondatemouseout" /></f:call>
+ <f:call name="writeEventHandlerFunction"><f:parameter
value="onexpand" /></f:call>
+ <f:call name="writeEventHandlerFunction"><f:parameter
value="oncollapse" /></f:call>
+ <f:call name="writeEventHandlerFunction"><f:parameter
value="oncurrentdateselect" /></f:call>
+
+ <jsp:scriptlet>/*<![CDATA[*/
+ if (component.getChildCount() != 0) {
+ /*]]>*/</jsp:scriptlet>
+ ,\n dayListMarkup:
+ <jsp:scriptlet>/*<![CDATA[*/
+ writeMarkupScriptBody(context, component, true);
+ }
+ /*]]>*/</jsp:scriptlet>
- <jsp:scriptlet>/*<![CDATA[*/
- if (component.getChildCount() != 0) {
- /*]]>*/</jsp:scriptlet>
- ,\n dayListMarkup:
- <jsp:scriptlet>/*<![CDATA[*/
- writeMarkupScriptBody(context, component, true);
- }
- /*]]>*/</jsp:scriptlet>
-
- <f:call name="writeOptionalFacetMarkupScriptBody"><f:parameter
value="optionalHeader" /></f:call>
- <f:call name="writeOptionalFacetMarkupScriptBody"><f:parameter
value="optionalFooter" /></f:call>
-
- <f:call name="writeFacetMarkupScriptBody"><f:parameter
value="weekDay" /></f:call>
- <f:call name="writeFacetMarkupScriptBody"><f:parameter
value="weekNumber" /></f:call>
- <f:call name="writeFacetMarkupScriptBody"><f:parameter
value="header" /></f:call>
- <f:call name="writeFacetMarkupScriptBody"><f:parameter
value="footer" /></f:call>
-
- }).load(
- <jsp:scriptlet>/*<![CDATA[*/
- writePreloadBody(context, component);
- /*]]>*/</jsp:scriptlet>
- );
- </script>
+ <f:call name="writeOptionalFacetMarkupScriptBody"><f:parameter
value="optionalHeader" /></f:call>
+ <f:call name="writeOptionalFacetMarkupScriptBody"><f:parameter
value="optionalFooter" /></f:call>
+
+ <f:call name="writeFacetMarkupScriptBody"><f:parameter
value="weekDay" /></f:call>
+ <f:call name="writeFacetMarkupScriptBody"><f:parameter
value="weekNumber" /></f:call>
+ <f:call name="writeFacetMarkupScriptBody"><f:parameter
value="header" /></f:call>
+ <f:call name="writeFacetMarkupScriptBody"><f:parameter
value="footer" /></f:call>
+
+ }).load(
+ <jsp:scriptlet>/*<![CDATA[*/
+ writePreloadBody(context, component);
+ /*]]>*/</jsp:scriptlet>
+ );
+ </script>
</div>
</f:root>