Author: hermanns Date: Wed Nov 15 11:02:53 2006 New Revision: 475363 URL: http://svn.apache.org/viewvc?view=rev&rev=475363 Log: upgrade struts2 dojo widget due to upgrading dojo to 0.4 o applying latest patch set
Issue Number: WW-1484 Submitted by: Musachy Barroso Added: struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotediv/example10.jsp struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotediv/example9.jsp Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/datepicker/index.jsp struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/dropdowndatepicker/index.jsp struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/dropdowntimepicker/index.jsp struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/footer.jsp struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/index.jsp struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotediv/index.jsp struts/struts2/trunk/core/src/main/resources/META-INF/struts-tags.tld struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/struts/widget/BindDiv.js Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/datepicker/index.jsp URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/datepicker/index.jsp?view=diff&rev=475363&r1=475362&r2=475363 ============================================================================== --- struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/datepicker/index.jsp (original) +++ struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/datepicker/index.jsp Wed Nov 15 11:02:53 2006 @@ -57,5 +57,6 @@ <p>nl-nl locale</p> <s:datepicker language="nl-nl" /> +<s:include value="../footer.jsp"/> </body> </html> Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/dropdowndatepicker/index.jsp URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/dropdowndatepicker/index.jsp?view=diff&rev=475363&r1=475362&r2=475363 ============================================================================== --- struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/dropdowndatepicker/index.jsp (original) +++ struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/dropdowndatepicker/index.jsp Wed Nov 15 11:02:53 2006 @@ -40,5 +40,6 @@ <p>Value sent as time since Unix Epoch</p> <s:dropdowndatetimepicker name="dddp16" saveFormat="posix" value="2006-06-26" language="en-us" /> +<s:include value="../footer.jsp"/> </body> </html> Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/dropdowntimepicker/index.jsp URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/dropdowntimepicker/index.jsp?view=diff&rev=475363&r1=475362&r2=475363 ============================================================================== --- struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/dropdowntimepicker/index.jsp (original) +++ struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/dropdowntimepicker/index.jsp Wed Nov 15 11:02:53 2006 @@ -46,6 +46,6 @@ <s:dropdowndatetimepicker type="time" name="dddp16" saveFormat="posix" value="3:45" language="en-us" /> <br/> - +<s:include value="../footer.jsp"/> </body> </html> Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/footer.jsp URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/footer.jsp?view=diff&rev=475363&r1=475362&r2=475363 ============================================================================== --- struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/footer.jsp (original) +++ struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/footer.jsp Wed Nov 15 11:02:53 2006 @@ -3,7 +3,6 @@ <hr/> <s:url id="backToAjaxExamples" value=".." /> -<s:url id="backToShowCase" action="showcase" namespace="/" /> <s:a href="%{backToAjaxExamples}">Back To AJAX Examples</s:a> -<s:a href="%{backToShowCase}">Back To Showcase</s:a> + Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/index.jsp URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/index.jsp?view=diff&rev=475363&r1=475362&r2=475363 ============================================================================== --- struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/index.jsp (original) +++ struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/index.jsp Wed Nov 15 11:02:53 2006 @@ -19,7 +19,6 @@ <li><a href="remoteforms">Remote forms</a></li> <li><a href="widgets">Widgets </a> (experimental - may not work in all browsers see the <a href="http://www.dojotoolkit.org">dojo website</a> for more information</li> - <li><a href=".."><i>Back to Showcase</i></a></li> </ul> </body> </html> Added: struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotediv/example10.jsp URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotediv/example10.jsp?view=auto&rev=475363 ============================================================================== --- struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotediv/example10.jsp (added) +++ struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotediv/example10.jsp Wed Nov 15 11:02:53 2006 @@ -0,0 +1,29 @@ +<%@ page contentType="text/html;charset=UTF-8" language="java" %> +<%@ taglib prefix="s" uri="/struts-tags" %> + +<html> +<head> + <title>Ajax Examples</title> + <jsp:include page="/ajax/commonInclude.jsp"/> +</head> + +<script type="text/javascript"> + function handler(widget, node) { + alert('I will handle this myself!'); + node.innerHTML = "Done"; + } +</script> + +<body> +<s:div + id="once" + theme="ajax" + cssStyle="border: 1px solid yellow;" + href="/AjaxTest.action" + handler="handler"> + Initial Content</s:div> + +<s:include value="../footer.jsp"/> + +</body> +</html> Added: struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotediv/example9.jsp URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotediv/example9.jsp?view=auto&rev=475363 ============================================================================== --- struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotediv/example9.jsp (added) +++ struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotediv/example9.jsp Wed Nov 15 11:02:53 2006 @@ -0,0 +1,47 @@ +<%@ page contentType="text/html;charset=UTF-8" language="java" %> +<%@ taglib prefix="s" uri="/struts-tags" %> + +<html> +<head> + <title>Ajax Examples</title> + <jsp:include page="/ajax/commonInclude.jsp"/> +</head> + +<body> + +<script> + var controller = { + refresh : function() {}, + start : function() {}, + stop : function() {} + }; + + dojo.event.topic.registerPublisher("/refresh", controller, "refresh"); + dojo.event.topic.registerPublisher("/startTimer", controller, "start"); + dojo.event.topic.registerPublisher("/stopTimer", controller, "stop"); + +</script> + +<input type=button value="refresh" onclick="controller.refresh()"> +<input type=button value="start timer" onclick="controller.start()"> +<input type=button value="stop timer" onclick="controller.stop()"> + +<s:div + id="once" + theme="ajax" + cssStyle="border: 1px solid yellow;" + href="/AjaxTest.action" + refreshListenTopic="/refresh" + startTimerListenTopic="/startTimer" + stopTimerListenTopic="/stopTimer" + updateInterval="10000" + autoStart="false" + beforeLoading="alert('before request')" + afterLoading="alert('after request')" + > + Initial Content</s:div> + +<s:include value="../footer.jsp"/> + +</body> +</html> Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotediv/index.jsp URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotediv/index.jsp?view=diff&rev=475363&r1=475362&r2=475363 ============================================================================== --- struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotediv/index.jsp (original) +++ struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotediv/index.jsp Wed Nov 15 11:02:53 2006 @@ -28,7 +28,7 @@ </li> <li> - <a href="example5.jsp">A simple DIV's that cannot contact the serverm, with fixed error message</a> + <a href="example5.jsp">A simple DIV's that cannot contact the server, with fixed error message</a> </li> Modified: struts/struts2/trunk/core/src/main/resources/META-INF/struts-tags.tld URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/META-INF/struts-tags.tld?view=diff&rev=475363&r1=475362&r2=475363 ============================================================================== --- struts/struts2/trunk/core/src/main/resources/META-INF/struts-tags.tld (original) +++ struts/struts2/trunk/core/src/main/resources/META-INF/struts-tags.tld Wed Nov 15 11:02:53 2006 @@ -464,7 +464,7 @@ <description><![CDATA[The i18n key attribute to be specified in place of the name, value and label attributes]]></description> </attribute> - + <attribute> <name>required</name> <required>false</required> @@ -1710,6 +1710,14 @@ <description> <![CDATA[Supply an image src for <i>image</i> type submit button. Will have no effect for types <i>input</i> and <i>button</i>.]]></description> + + </attribute> + <attribute> + <name>action</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + + <description><![CDATA[Set action nane to submit to, without .action suffix]]></description> </attribute> <attribute> Modified: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/struts/widget/BindDiv.js URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/struts/widget/BindDiv.js?view=diff&rev=475363&r1=475362&r2=475363 ============================================================================== --- struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/struts/widget/BindDiv.js (original) +++ struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/struts/widget/BindDiv.js Wed Nov 15 11:02:53 2006 @@ -68,6 +68,8 @@ }, postCreate : function(args, frag) { + struts.widget.BindDiv.superclass.postCreate.apply(this); + var self = this; var hitchedRefresh = function() { dojo.lang.hitch(self, "refresh")(); @@ -79,39 +81,34 @@ if(this.updateInterval > 0) { this.timer = new dojo.lang.timing.Timer(this.updateInterval); this.timer.onTick = hitchedRefresh; - - //start the timer - if(this.autoStart) { - //start after delay - dojo.lang.setTimeout(this.delay, hitchedStartTimer); - if(this.delay === 0) { - //load content now - this.refresh(); - } - } } - else { - if(this.autoStart) { - //start after delay - dojo.lang.setTimeout(this.delay, hitchedRefresh); + + var delay = this.delay >= 0 ? this.delay : 0; + //start the timer + if(this.autoStart) { + //start after delay + dojo.lang.setTimeout(delay, hitchedStartTimer); + if(delay === 0) { + //load content now + this.refresh(); } } - //attach listeners - if(!dojo.string.isBlank(this.refreshListenTopic)) { - this.log("Listening to " + this.refreshListenTopic + " to refresh"); - dojo.event.topic.subscribe(this.refreshListenTopic, this, "refresh"); - } - if(!dojo.string.isBlank(this.stopTimerListenTopic)) { - this.log("Listening to " + this.stopTimerListenTopic + " to stop timer"); - dojo.event.topic.subscribe(this.stopTimerListenTopic, this, "stopTimer"); - } - if(!dojo.string.isBlank(this.startTimerListenTopic)) { - this.log("Listening to " + this.startTimerListenTopic + " to start timer"); - dojo.event.topic.subscribe(this.startTimerListenTopic, this, "startTimer"); - } + //attach listeners + if(!dojo.string.isBlank(this.refreshListenTopic)) { + this.log("Listening to " + this.refreshListenTopic + " to refresh"); + dojo.event.topic.subscribe(this.refreshListenTopic, this, "refresh"); + } + if(!dojo.string.isBlank(this.stopTimerListenTopic)) { + this.log("Listening to " + this.stopTimerListenTopic + " to stop timer"); + dojo.event.topic.subscribe(this.stopTimerListenTopic, this, "stopTimer"); + } + if(!dojo.string.isBlank(this.startTimerListenTopic)) { + this.log("Listening to " + this.startTimerListenTopic + " to start timer"); + dojo.event.topic.subscribe(this.startTimerListenTopic, this, "startTimer"); + } - if(!dojo.string.isBlank(this.afterLoading)) { + if(!dojo.string.isBlank(this.afterLoading)) { dojo.event.connect("after", this, "onDownloadEnd", function(){ self.log("Executing " + self.afterLoading); eval(self.afterLoading);