
var SimpleAutoCompleteComponent = BaseComponent.extend({

    ph: undefined,
    completionCallback: undefined,

    update: function() {
      this.ph = $("#" + this.htmlObject).empty();
      this.input = $("<input type='text'>").appendTo(this.ph);
      this.query = new Query(this.queryDefinition);
      var myself = this;
      this.input.autocomplete({
        source:function(term,callback){return myself.triggerQuery(term,callback);}
      });
    },

    handleQuery: function(callback) {
      var myself = this;
      return function(values) {
        if(typeof myself.postFetch == "function") {
          var changedValues = myself.postFetch(values);
          values = changedValues || values;
        };
        var results = values.resultset.map(function(e){return e[0];});
        callback(results);
      }
    },

    triggerQuery: function(term,callback){
      var params = $.extend([],this.parameters);
      params.push([this.termParam,term]);
      if(term.length >= this.minTextLength) {
        this.query.fetchData(params,this.handleQuery(callback));
      } else {
        callback([]);
      }
    }
})



@@ -128,24 +128,49 @@
 unction() %7B%0A
+      var myself = this;%0A
       this.p
@@ -207,16 +207,16 @@
 mpty();%0A
-
       th
@@ -395,36 +395,35 @@
 source:function(
-term
+obj
 ,callback)%7Bretur
@@ -444,16 +444,20 @@
 erQuery(
+obj.
 term,cal
@@ -471,24 +471,243 @@
 %7D%0A      %7D);%0A
+      this.input.change(function()%7B%0A        Dashboards.processChange(myself.name);%0A      %7D).keyup(function(event)%7B%0A        if (event.keyCode == 13) %7B%0A          Dashboards.processChange(myself.name);%0A        %7D%0A      %7D);%0A
     %7D,%0A%0A    
@@ -1176,43 +1176,76 @@
     
+if (
 params.
-push(%5Bthis.termParam,term%5D);
+length) %7B%0A        params%5B0%5D%5B1%5D = %22'%22 + term+ %22'%22;%0A      %7D
 %0A   
@@ -1389,24 +1389,24 @@
 ck(%5B%5D);%0A
-
       %7D%0A
     %7D%0A%7D)
@@ -1393,23 +1393,88 @@
 %5D);%0A      %7D%0A
+    %7D,%0A    getValue: function() %7B%0A      return this.input.val();%0A
     %7D%0A%7D)%0A%0A%0A

Fix some bugs with simple autocomplete