[Mapbender-commits] r6049 - trunk/mapbender/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Apr 30 03:54:44 EDT 2010


Author: christoph
Date: 2010-04-30 03:54:43 -0400 (Fri, 30 Apr 2010)
New Revision: 6049

Modified:
   trunk/mapbender/http/javascripts/map.php
Log:
hardwired values possible in inputs

Modified: trunk/mapbender/http/javascripts/map.php
===================================================================
--- trunk/mapbender/http/javascripts/map.php	2010-04-29 15:35:23 UTC (rev 6048)
+++ trunk/mapbender/http/javascripts/map.php	2010-04-30 07:54:43 UTC (rev 6049)
@@ -267,13 +267,27 @@
 						var link = i.linkedTo[q];
 						var method = i.method;
 						var element = $("#" + link.id).mapbender();
-						element.events[link.event].register(function (obj) {
-							var target = $("#" + settings.id).mapbender();
-							if (target && typeof target[i.method] === "function") {
-								var arg = (!obj || !obj[link.attr]) ? undefined : obj[link.attr];
-								target[i.method](arg);
-							}
-						});
+						if (typeof element.events === "undefined") {
+							new Mapbender.Exception("Unknown element " + link.id);
+						}
+						else {
+							element.events[link.event].register(function (obj) {
+								var target = $("#" + settings.id).mapbender();
+								if (target && typeof target[i.method] === "function") {
+									if (typeof link.value !== "undefined") {
+										new Mapbender.Notice("Method '" + i.method + "' in element '" + settings.id + "' called with HARDWIRED value '" + $.toJSON(link.value) + "' by event '" + link.event + "' in element '" + link.id + "'.");
+//										console.log("Method '" + i.method + "' in element '" + settings.id + "' called with HARDWIRED value " + $.toJSON(link.value) + " by event '" + link.event + "' in element '" + link.id + "'.");
+										target[i.method](link.value);
+									}
+									else {
+										var arg = (!obj || !obj[link.attr]) ? undefined : obj[link.attr];
+										new Mapbender.Notice("Method '" + i.method + "' in element '" + settings.id + "' called with value '" + $.toJSON(arg) + "' by event '" + link.event + "' in element '" + link.id + "'.");
+//										console.log("Method '" + i.method + "' in element '" + settings.id + "' called with value " + $.toJSON(arg) + " by event '" + link.event + "' in element '" + link.id + "'.");
+										target[i.method](arg);
+									}
+								}
+							});
+						}
 					})();
 				}
 			})();



More information about the Mapbender_commits mailing list