From 2da24979d21d35bc930f2e01a57b64f9cd51a4d8 Mon Sep 17 00:00:00 2001 From: Musachy Barroso Date: Mon, 28 May 2007 21:41:04 +0000 Subject: [PATCH] * Make "sources" and "events" attributes optional in "bind" tag * Fix minor notifyTopics bug on "binddiv" and "bind" (wrong parameters were passed when the returned text was an empty string) git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@542324 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/struts2/dojo/components/Bind.java | 4 ++-- .../org/apache/struts2/static/dojo/struts/widget/Bind.js | 2 +- .../apache/struts2/static/dojo/struts/widget/BindDiv.js | 2 +- plugins/dojo/src/main/resources/template/ajax/bind.ftl | 8 ++++++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Bind.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Bind.java index 869c11600..6283aef2e 100644 --- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Bind.java +++ b/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Bind.java @@ -137,12 +137,12 @@ public class Bind extends AbstractValidateBean { 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; } diff --git a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/Bind.js b/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/Bind.js index 29f40c04a..ee9c59190 100644 --- a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/Bind.js +++ b/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/Bind.js @@ -239,7 +239,7 @@ dojo.widget.defineWidget( 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); diff --git a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/BindDiv.js b/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/BindDiv.js index 99c83b1d4..4bac37afc 100644 --- a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/BindDiv.js +++ b/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/BindDiv.js @@ -133,7 +133,7 @@ dojo.widget.defineWidget( 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); diff --git a/plugins/dojo/src/main/resources/template/ajax/bind.ftl b/plugins/dojo/src/main/resources/template/ajax/bind.ftl index 114d2fe5c..369b205f2 100644 --- a/plugins/dojo/src/main/resources/template/ajax/bind.ftl +++ b/plugins/dojo/src/main/resources/template/ajax/bind.ftl @@ -1,8 +1,12 @@