mirror of
https://github.com/apache/struts.git
synced 2026-08-11 01:27:14 +00:00
* 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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user