Author: musachy
Date: Mon May 28 14:41:04 2007
New Revision: 542324

URL: http://svn.apache.org/viewvc?view=rev&rev=542324
Log:
* Make "sources" and "events

Modified:
    
struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Bind.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/template/ajax/bind.ftl

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=542324&r1=542323&r2=542324
==============================================================================
--- 
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
 Mon May 28 14:41:04 2007
@@ -137,12 +137,12 @@
             addParameter("events", findString(events));
     }
     
-    @StrutsTagAttribute(description="Comma delimited list of event names to 
attach to", required=true)
+    @StrutsTagAttribute(description="Comma delimited list of event names to 
attach to")
     public void setEvents(String events) {
         this.events = events;
     }
 
-    @StrutsTagAttribute(description="Comma delimited list of ids of the 
elements to attach to", required=true)
+    @StrutsTagAttribute(description="Comma delimited list of ids of the 
elements to attach to")
     public void setSources(String sources) {
         this.sources = sources;
     }

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=542324&r1=542323&r2=542324
==============================================================================
--- 
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
 Mon May 28 14:41:04 2007
@@ -239,7 +239,7 @@
     if(topicsArray) {
       dojo.lang.forEach(topicsArray, function(topic) {
       try {
-        if(data) {
+        if(data != null) {
           dojo.event.topic.publish(topic, data, e, self);
         } else {
           dojo.event.topic.publish(topic, e, self);

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=542324&r1=542323&r2=542324
==============================================================================
--- 
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
 Mon May 28 14:41:04 2007
@@ -133,7 +133,7 @@
       if(topicsArray) {
         dojo.lang.forEach(topicsArray, function(topic) {
         try {
-          if(data) {
+          if(data != null) {
             dojo.event.topic.publish(topic, data, e, self);
           } else {
             dojo.event.topic.publish(topic, e, self);

Modified: 
struts/struts2/trunk/plugins/dojo/src/main/resources/template/ajax/bind.ftl
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/dojo/src/main/resources/template/ajax/bind.ftl?view=diff&rev=542324&r1=542323&r2=542324
==============================================================================
--- struts/struts2/trunk/plugins/dojo/src/main/resources/template/ajax/bind.ftl 
(original)
+++ struts/struts2/trunk/plugins/dojo/src/main/resources/template/ajax/bind.ftl 
Mon May 28 14:41:04 2007
@@ -1,8 +1,12 @@
 <script language="JavaScript" type="text/javascript">
        dojo.addOnLoad(function() {
                dojo.widget.createWidget("struts:BindEvent", {
-                       "sources": "${parameters.sources?html}",<#rt/>
-                       "events": "${parameters.events?html}",<#rt/>
+                   <#if parameters.sources?if_exists != "">
+                "sources": "${parameters.sources?html}",<#rt/>
+            </#if>
+            <#if parameters.events?if_exists != "">
+                "events": "${parameters.events?html}",<#rt/>
+            </#if>
                        <#if parameters.id?if_exists != "">
                                "id": "${parameters.id?html}",<#rt/>
                    </#if>


Reply via email to