Author: nbelaevski
Date: 2007-06-15 07:25:23 -0400 (Fri, 15 Jun 2007)
New Revision: 1197
Modified:
trunk/sandbox-samples/calendar-sample/src/main/webapp/pages/index.jsp
trunk/sandbox/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
trunk/sandbox/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
Log:
Sample & script updated
Modified:
trunk/sandbox/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
---
trunk/sandbox/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2007-06-15
10:11:36 UTC (rev 1196)
+++
trunk/sandbox/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2007-06-15
11:25:23 UTC (rev 1197)
@@ -119,7 +119,11 @@
int bodyChildrenLength = bodyChildren.getLength();
writer.startElement("script", component);
- writer.write("var calendarEval = function (string, context) { return string;
};");
+ writer.write("calendarEval = function(template, object)" +
+"{" +
+" var value=\"\";"+
+" try { with (object) value=eval(template) } catch (e) { LOG.warn('Exception:
'+e.message + '\\n[' + template + ']'); }"+
+" return value;};");
writer.write("var evaluator = new Object(); evaluator.parts = [ ");
@@ -151,7 +155,7 @@
writer.write("]; evaluator.evaluate = function (context) { var result =
'';");
writer.write(" for (var i = 0; i < this.parts.length; i++) result +=
this.parts[i].getOuterHTML(context); return result;};\n");
- writer.write("new Insertion.Top($('" + component.getClientId(context) +
"'), evaluator.evaluate(null));");
+ writer.write("new Insertion.Top($('" + component.getClientId(context) +
"'), evaluator.evaluate(window));");
writer.endElement("script");
}
}
Modified: trunk/sandbox/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
===================================================================
--- trunk/sandbox/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-06-15
10:11:36 UTC (rev 1196)
+++ trunk/sandbox/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-06-15
11:25:23 UTC (rev 1197)
@@ -11,7 +11,7 @@
component="org.richfaces.component.UICalendar"
<f:clientid var="clientId"/>
- <h:scripts>new
org.ajax4jsf.framework.resource.PrototypeScript(),/org/richfaces/renderkit/html/scripts/json/json-dom.js</h:scripts>
+ <h:scripts>new org.ajax4jsf.framework.resource.PrototypeScript(),new
org.ajax4jsf.framework.ajax.AjaxScript(),/org/richfaces/renderkit/html/scripts/json/json-dom.js</h:scripts>
<div id="#{clientId}"
x:passThruWithExclusions="value,name,type,id"
Modified: trunk/sandbox-samples/calendar-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/sandbox-samples/calendar-sample/src/main/webapp/pages/index.jsp 2007-06-15
10:11:36 UTC (rev 1196)
+++ trunk/sandbox-samples/calendar-sample/src/main/webapp/pages/index.jsp 2007-06-15
11:25:23 UTC (rev 1197)
@@ -7,6 +7,12 @@
</head>
<body>
<f:view>
+ <f:verbatim>
+ <script>
+ window.test = "test var text";
+ </script>
+ </f:verbatim>
+
<f:verbatim><h3>HTML tidying test</h3></f:verbatim>
<calendar:calendar>
<h:outputText escape="false" value="<br
xmlns:test='urn:test' test:aaa='sss'> &<a
href='#' class='{test}'>end<div
xmlns:prefix='urn:urn'><p value='aaa'><p
value='bbb'></p></div>" />
@@ -16,6 +22,8 @@
<f:verbatim><h3>Templating test</h3></f:verbatim>
<calendar:calendar>
<f:verbatim><input type="text" value="$ {test} $"
/></f:verbatim>
+
+ <f:verbatim><input type="radio" checked="{test}"
/><input type="radio" checked="{test1}"
/></f:verbatim>
</calendar:calendar>
</f:view>
</body>