You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by mu...@apache.org on 2007/04/21 17:07:10 UTC
svn commit: r531046 [1/3] - in /struts/struts2/trunk:
apps/showcase/src/main/webapp/ajax/ apps/showcase/src/main/webapp/ajax/bind/
apps/showcase/src/main/webapp/ajax/remotebutton/
apps/showcase/src/main/webapp/ajax/remotediv/ apps/showcase/src/main/web...
Author: musachy
Date: Sat Apr 21 08:07:08 2007
New Revision: 531046
URL: http://svn.apache.org/viewvc?view=rev&rev=531046
Log:
WW-1891 Add highlight effect to "targets" for the ajax tags
Modified:
struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/bind/index.jsp
struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/commonInclude.jsp
struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotebutton/index.jsp
struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotediv/example2.jsp
struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotediv/example8.jsp
struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotediv/index.jsp
struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotelink/index.jsp
struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/AbstractRemoteCallUIBean.java
struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Bind.java
struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Div.java
struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/RemoteUICallBean.java
struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Submit.java
struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/AbstractRemoteCallUITag.java
struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/SubmitTag.java
struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/Bind.js
struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/BindDiv.js
struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts_dojo.js
struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts_dojo.js.uncompressed.js
struts/struts2/trunk/plugins/dojo/src/main/resources/template/ajax/ajax-common.ftl
struts/struts2/trunk/plugins/dojo/src/main/resources/template/ajax/bind.ftl
struts/struts2/trunk/plugins/dojo/src/test/java/org/apache/struts2/dojo/views/jsp/ui/AnchorTest.java
struts/struts2/trunk/plugins/dojo/src/test/java/org/apache/struts2/dojo/views/jsp/ui/BindTest.java
struts/struts2/trunk/plugins/dojo/src/test/java/org/apache/struts2/dojo/views/jsp/ui/DivTest.java
struts/struts2/trunk/plugins/dojo/src/test/java/org/apache/struts2/dojo/views/jsp/ui/SubmitAjaxTest.java
struts/struts2/trunk/plugins/dojo/src/test/resources/org/apache/struts2/dojo/views/jsp/ui/Bind-1.txt
struts/struts2/trunk/plugins/dojo/src/test/resources/org/apache/struts2/dojo/views/jsp/ui/div-1.txt
struts/struts2/trunk/plugins/dojo/src/test/resources/org/apache/struts2/dojo/views/jsp/ui/href-1.txt
struts/struts2/trunk/plugins/dojo/src/test/resources/org/apache/struts2/dojo/views/jsp/ui/submit-ajax-1.txt
Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/bind/index.jsp
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/bind/index.jsp?view=diff&rev=531046&r1=531045&r2=531046
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/bind/index.jsp (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/bind/index.jsp Sat Apr 21 08:07:08 2007
@@ -33,8 +33,8 @@
</p>
<br/><br/>
<p>
- 2. Attach to "onmouseover", and "onclick" event on Area below and update content of Div1.
- <sx:bind id="ex2" href="%{#ajaxTest}" sources="div2" targets="div1" events="onmouseover,onclick" />
+ 2. Attach to "onmouseover", and "onclick" event on Area below and update content of Div1, highlight targets with green color
+ <sx:bind id="ex2" href="%{#ajaxTest}" sources="div2" targets="div1" events="onmouseover,onclick" highlightColor="green"/>
<div id="div2" style="width: 300px; height: 50px; border: 1px solid black">
Mouse Over or Click Here!
</div>
Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/commonInclude.jsp
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/commonInclude.jsp?view=diff&rev=531046&r1=531045&r2=531046
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/commonInclude.jsp (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/commonInclude.jsp Sat Apr 21 08:07:08 2007
@@ -1,5 +1,5 @@
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
<!--// START SNIPPET: common-include-->
-<sx:head debug="true"/>
+<sx:head cache="true"/>
<!--// END SNIPPET: common-include-->
Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotebutton/index.jsp
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotebutton/index.jsp?view=diff&rev=531046&r1=531045&r2=531046
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotebutton/index.jsp (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotebutton/index.jsp Sat Apr 21 08:07:08 2007
@@ -29,6 +29,10 @@
<div id="t1">Div 1</div>
<s:url id="ajaxTest" value="/AjaxTest.action" />
+<br/><br/>
+
+A submit button, that highlights (blue color) its targets
+<sx:submit type="submit" value="submit" targets="t1" href="%{ajaxTest}" highlightColor="blue"/>
<br/><br/>
Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotediv/example2.jsp
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotediv/example2.jsp?view=diff&rev=531046&r1=531045&r2=531046
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotediv/example2.jsp (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotediv/example2.jsp Sat Apr 21 08:07:08 2007
@@ -16,7 +16,7 @@
<sx:div
id="once"
cssStyle="border: 1px solid yellow;"
- href="%{ajaxTest}"
+ href="%{#ajaxTest}"
updateFreq="2000"
indicator="indicator"
>
Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotediv/example8.jsp
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotediv/example8.jsp?view=diff&rev=531046&r1=531045&r2=531046
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotediv/example8.jsp (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotediv/example8.jsp Sat Apr 21 08:07:08 2007
@@ -46,6 +46,7 @@
stopTimerListenTopics="/stopTimer"
updateFreq="3000"
autoStart="true"
+ highlightColor="red"
formId="form"
>
Initial Content</sx:div>
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=531046&r1=531045&r2=531046
==============================================================================
--- 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 Sat Apr 21 08:07:08 2007
@@ -37,7 +37,7 @@
</li>
<li>
- <a href="example8.jsp">A div that will listen to events to refresh and start/stop autoupdate</a>
+ <a href="example8.jsp">A div that will listen to events to refresh and start/stop autoupdate, and gets highlighted in red (when it loads)</a>
</li>
<li>
Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotelink/index.jsp
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotelink/index.jsp?view=diff&rev=531046&r1=531045&r2=531046
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotelink/index.jsp (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotelink/index.jsp Sat Apr 21 08:07:08 2007
@@ -57,10 +57,16 @@
<s:url id="ajaxTest" value="/AjaxTest.action" />
<s:url id="test3" value="/Test3.action" />
+<sx:a id="link0"
+ href="%{#ajaxTest}"
+ targets="t1"
+ highlightColor="red"
+ highlightDuration="2000">Update 'Div 1' and use red highligh to notify user of changed content</sx:a>
+
<br/><br/>
<sx:a id="link1"
- href="%{ajaxTest}"
+ href="%{#ajaxTest}"
indicator="indicator"
targets="t1,t2"
beforeNotifyTopics="/before"
@@ -78,21 +84,21 @@
<br/><br/>
<sx:a id="link3"
- href="%{ajaxTest}"
+ href="%{#ajaxTest}"
loadingText="Loading!!!"
targets="t1">Update 'Div 1', use custom loading message</sx:a>
<br/><br/>
<sx:a id="link4"
- href="%{test3}"
+ href="%{#test3}"
executeScripts="true"
targets="t2">Update 'Div 2' and execute returned javascript </sx:a>
<br/><br/>
<sx:a id="link5"
- href="%{ajaxTest}"
+ href="%{#ajaxTest}"
handler="handler"
targets="t2">Update 'Div 2' using a custom handler </sx:a>
@@ -108,7 +114,7 @@
<br/><br/>
<sx:a id="link6"
- href="%{ajaxTest}"
+ href="%{#ajaxTest}"
targets="t2"
formId="form"
>Update 'Div 2' with the content of the textbox </sx:a>
Modified: struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/AbstractRemoteCallUIBean.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/AbstractRemoteCallUIBean.java?view=diff&rev=531046&r1=531045&r2=531046
==============================================================================
--- struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/AbstractRemoteCallUIBean.java (original)
+++ struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/AbstractRemoteCallUIBean.java Sat Apr 21 08:07:08 2007
@@ -47,6 +47,8 @@
protected String beforeNotifyTopics;
protected String afterNotifyTopics;
protected String errorNotifyTopics;
+ protected String highlightColor;
+ protected String highlightDuration;
public AbstractRemoteCallUIBean(ValueStack stack, HttpServletRequest request,
HttpServletResponse response) {
@@ -88,6 +90,10 @@
addParameter("afterNotifyTopics", findString(afterNotifyTopics));
if (errorNotifyTopics != null)
addParameter("errorNotifyTopics", findString(errorNotifyTopics));
+ if (highlightColor != null)
+ addParameter("highlightColor", findString(highlightColor));
+ if (highlightDuration != null)
+ addParameter("highlightDuration", findString(highlightDuration));
}
@Override
@@ -198,5 +204,17 @@
@StrutsTagAttribute(description="Comma delimmited list of topics that will published after the request(if the request fails)")
public void setErrorNotifyTopics(String errorNotifyTopics) {
this.errorNotifyTopics = errorNotifyTopics;
+ }
+
+ @StrutsTagAttribute(description = "Color used to perform a highlight effect on the elements specified in the 'targets' attribute",
+ defaultValue = "none")
+ public void setHighlightColor(String highlightColor) {
+ this.highlightColor = highlightColor;
+ }
+
+ @StrutsTagAttribute(description = "Duration of highlight effect in milliseconds. Only valid if 'highlightColor' attribute is set",
+ defaultValue = "2000", type="Integer")
+ public void setHighlightDuration(String highlightDuration) {
+ this.highlightDuration = highlightDuration;
}
}
Modified: struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Bind.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Bind.java?view=diff&rev=531046&r1=531045&r2=531046
==============================================================================
--- struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Bind.java (original)
+++ struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Bind.java Sat Apr 21 08:07:08 2007
@@ -160,7 +160,6 @@
this.notifyTopics = notifyTopics;
}
-
@StrutsTagAttribute(description="Set whether errors will be shown or not", type="Boolean", defaultValue="true")
public void setShowErrorTransportText(String showError) {
this.showErrorTransportText = showError;
@@ -209,5 +208,17 @@
@StrutsTagAttribute(description="The id to use for the element")
public void setId(String id) {
super.setId(id);
+ }
+
+ @StrutsTagAttribute(description = "Color used to perform a highlight effect on the elements specified in the 'targets' attribute",
+ defaultValue = "none")
+ public void setHighlightColor(String highlightColor) {
+ this.highlightColor = highlightColor;
+ }
+
+ @StrutsTagAttribute(description = "Duration of highlight effect in milliseconds. Only valid if 'highlightColor' attribute is set",
+ defaultValue = "2000", type="Integer")
+ public void setHighlightDuration(String highlightDuration) {
+ this.highlightDuration = highlightDuration;
}
}
Modified: struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Div.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Div.java?view=diff&rev=531046&r1=531045&r2=531046
==============================================================================
--- struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Div.java (original)
+++ struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Div.java Sat Apr 21 08:07:08 2007
@@ -154,4 +154,10 @@
public void setPreload(String preload) {
this.preload = preload;
}
+
+ @StrutsTagAttribute(description = "Color used to perform a highlight effect on this element",
+ defaultValue = "none")
+ public void setHighlightColor(String highlightColor) {
+ this.highlightColor = highlightColor;
+ }
}
Modified: struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/RemoteUICallBean.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/RemoteUICallBean.java?view=diff&rev=531046&r1=531045&r2=531046
==============================================================================
--- struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/RemoteUICallBean.java (original)
+++ struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/RemoteUICallBean.java Sat Apr 21 08:07:08 2007
@@ -58,4 +58,8 @@
void setCssStyle(String style);
void setCssClass(String cssClass);
+
+ void setHighlightColor(String color);
+
+ void setHighlightDuration(String color);
}
Modified: struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Submit.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Submit.java?view=diff&rev=531046&r1=531045&r2=531046
==============================================================================
--- struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Submit.java (original)
+++ struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Submit.java Sat Apr 21 08:07:08 2007
@@ -116,6 +116,8 @@
protected String beforeNotifyTopics;
protected String afterNotifyTopics;
protected String errorNotifyTopics;
+ protected String highlightColor;
+ protected String highlightDuration;
public Submit(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
super(stack, request, response);
@@ -174,6 +176,10 @@
addParameter("afterNotifyTopics", findString(afterNotifyTopics));
if (errorNotifyTopics != null)
addParameter("errorNotifyTopics", findString(errorNotifyTopics));
+ if (highlightColor != null)
+ addParameter("highlightColor", findString(highlightColor));
+ if (highlightDuration != null)
+ addParameter("highlightDuration", findString(highlightDuration));
}
@Override
@@ -334,5 +340,17 @@
@StrutsTagAttribute(description="Comma delimmited list of topics that will published after the request(if the request fails)")
public void setErrorNotifyTopics(String errorNotifyTopics) {
this.errorNotifyTopics = errorNotifyTopics;
+ }
+
+ @StrutsTagAttribute(description = "Color used to perform a highlight effect on the elements specified in the 'targets' attribute",
+ defaultValue = "none")
+ public void setHighlightColor(String highlightColor) {
+ this.highlightColor = highlightColor;
+ }
+
+ @StrutsTagAttribute(description = "Duration of highlight effect in milliseconds. Only valid if 'highlightColor' attribute is set",
+ defaultValue = "1000")
+ public void setHighlightDuration(String highlightDuration) {
+ this.highlightDuration = highlightDuration;
}
}
Modified: struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/AbstractRemoteCallUITag.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/AbstractRemoteCallUITag.java?view=diff&rev=531046&r1=531045&r2=531046
==============================================================================
--- struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/AbstractRemoteCallUITag.java (original)
+++ struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/AbstractRemoteCallUITag.java Sat Apr 21 08:07:08 2007
@@ -37,7 +37,9 @@
protected String beforeNotifyTopics;
protected String afterNotifyTopics;
protected String errorNotifyTopics;
-
+ protected String highlightColor;
+ protected String highlightDuration;
+
protected void populateParams() {
super.populateParams();
@@ -57,6 +59,8 @@
remote.setAfterNotifyTopics(afterNotifyTopics);
remote.setBeforeNotifyTopics(beforeNotifyTopics);
remote.setErrorNotifyTopics(errorNotifyTopics);
+ remote.setHighlightColor(highlightColor);
+ remote.setHighlightDuration(highlightDuration);
}
public void setHref(String href) {
@@ -117,5 +121,13 @@
public void setErrorNotifyTopics(String errorNotifyTopics) {
this.errorNotifyTopics = errorNotifyTopics;
+ }
+
+ public void setHighlightColor(String highlightColor) {
+ this.highlightColor = highlightColor;
+ }
+
+ public void setHighlightDuration(String highlightDuration) {
+ this.highlightDuration = highlightDuration;
}
}
Modified: struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/SubmitTag.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/SubmitTag.java?view=diff&rev=531046&r1=531045&r2=531046
==============================================================================
--- struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/SubmitTag.java (original)
+++ struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/SubmitTag.java Sat Apr 21 08:07:08 2007
@@ -57,6 +57,8 @@
protected String beforeNotifyTopics;
protected String afterNotifyTopics;
protected String errorNotifyTopics;
+ protected String highlightColor;
+ protected String highlightDuration;
public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
return new Submit(stack, req, res);
@@ -87,6 +89,8 @@
submit.setAfterNotifyTopics(afterNotifyTopics);
submit.setBeforeNotifyTopics(beforeNotifyTopics);
submit.setErrorNotifyTopics(errorNotifyTopics);
+ submit.setHighlightColor(highlightColor);
+ submit.setHighlightDuration(highlightDuration);
}
public void setAction(String action) {
@@ -175,5 +179,13 @@
public void setErrorNotifyTopics(String errorNotifyTopics) {
this.errorNotifyTopics = errorNotifyTopics;
+ }
+
+ public void setHighlightColor(String highlightColor) {
+ this.highlightColor = highlightColor;
+ }
+
+ public void setHighlightDuration(String highlightDuration) {
+ this.highlightDuration = highlightDuration;
}
}
Modified: struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/Bind.js
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/Bind.js?view=diff&rev=531046&r1=531045&r2=531046
==============================================================================
--- struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/Bind.js (original)
+++ struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/Bind.js Sat Apr 21 08:07:08 2007
@@ -1,6 +1,7 @@
dojo.provide("struts.widget.Bind");
dojo.require("dojo.widget.HtmlWidget");
+dojo.require("dojo.lfx.html");
dojo.require("dojo.io.*");
dojo.widget.defineWidget(
@@ -38,6 +39,10 @@
indicator : "",
parseContent : true,
+
+ highlightColor : "",
+ highlightDuration : 2000,
+
postCreate : function() {
var self = this;
@@ -90,7 +95,6 @@
}
}
-
if(dojo.string.isBlank(this.href) && dojo.string.isBlank(this.formId)) {
//no href and no formId, we must be inside a form
this.formNode = dojo.dom.getFirstAncestorByTag(this.domNode, "form");
@@ -107,6 +111,21 @@
}
},
+ highlight : function() {
+ if(!dojo.string.isBlank(this.highlightColor)) {
+ var nodes = [];
+ //add nodes to array
+ dojo.lang.forEach(this.targetsArray, function(target) {
+ var node = dojo.byId(target);
+ if(node) {
+ nodes.push(node);
+ }
+ });
+ var effect = dojo.lfx.html.highlight(nodes, this.highlightColor, this.highlightDuration);
+ effect.play();
+ }
+ },
+
log : function(text) {
dojo.debug("[" + (this.widgetId ? this.widgetId : "unknown") + "] " + text);
},
@@ -155,6 +174,7 @@
else {
this.setContent(data);
}
+ this.highlight();
} else {
if(this.showError) {
var message = dojo.string.isBlank(this.errorText) ? e.message : this.errorText;
Modified: struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/BindDiv.js
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/BindDiv.js?view=diff&rev=531046&r1=531045&r2=531046
==============================================================================
--- struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/BindDiv.js (original)
+++ struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/BindDiv.js Sat Apr 21 08:07:08 2007
@@ -56,6 +56,9 @@
//make dojo process the content
parseContent : true,
+ highlightColor : "",
+ highlightDuration : 2000,
+
onDownloadStart : function(event) {
if(!this.showLoading) {
event.returnValue = false;
@@ -65,6 +68,13 @@
event.text = this.loadingText;
}
},
+
+ highlight : function() {
+ if(!dojo.string.isBlank(this.highlightColor)) {
+ var effect = dojo.lfx.html.highlight([this.domNode], this.highlightColor, this.highlightDuration);
+ effect.play();
+ }
+ },
onDownloadError : function(event) {
this.onError(event);
@@ -250,6 +260,7 @@
if(type == "load") {
self.onDownloadEnd.call(self, url, data);
+ self.highlight();
} else {
// works best when from a live server instead of from file system
self._handleDefaults.call(self, "Error loading '" + url + "' (" + e.status + " "+ e.statusText + ")", "onDownloadError");