Part of ACREP-80: new 'widget' parameter to team.newSearch
[mkws-moved-to-github.git] / src / mkws-widget.js
index 05e39ca..cb5708a 100644 (file)
@@ -104,6 +104,10 @@ mkws.makeWidget = function($, team, type, node) {
     var that = this;
     var query = this.config.autosearch;
     if (query) {
+      // Should do this more elegantly with message passing
+      var widget = this.team.widget('query');
+      if (widget) { widget.node.val(query); }
+
       this.team.queue("ready").subscribe(function() {
         // Postpone testing for the configuration items: these are not
         // yet set for Record subclass widgets that fill them in in the
@@ -127,7 +131,7 @@ mkws.makeWidget = function($, team, type, node) {
         if (targetfilter) s += " constrained by targetfilter '" + targetfilter + "'";
         that.info(s);
 
-        that.team.newSearch(query, sortOrder, maxrecs, perpage, limit, targets, targetfilter);
+        that.team.newSearch(that, query, sortOrder, maxrecs, perpage, limit, targets, targetfilter);
       });
     }
   };