Index: Dev/branches/rest-dojo-ui/client/rft/elastic/ElasticReadStore.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/elastic/ElasticReadStore.js	(revision 366)
+++ Dev/branches/rest-dojo-ui/client/rft/elastic/ElasticReadStore.js	(revision 367)
@@ -5,86 +5,44 @@
 
 	dojo.declare("rft.elastic.ElasticReadStore", dojox.data.QueryReadStore, {
-	  fetch:function(request){
-	    request.serverQuery = dojo.toJson({ 
-	    						query: 
-	    						{
-	    							query_string: 
-	    							{
-	    								default_field: "title", 
-	    								query: request.query.title
-	    							}
-	    						}
-	    					});
-	    // Call superclasses' fetch
-	    return this.inherited("fetch", arguments);
-	  },
-
-	  fetch:function(/* Object? */ request){
-			//	summary:
-			//		See dojo.data.util.simpleFetch.fetch() this is just a copy and I adjusted
-			//		only the paging, since it happens on the server if doClientPaging is
-			//		false, thx to http://trac.dojotoolkit.org/ticket/4761 reporting this.
-			//		Would be nice to be able to use simpleFetch() to reduce copied code,
-			//		but i dont know how yet. Ideas please!
-			request = request || {};
-			if(!request.store){
-				request.store = this;
+	    fetch:function(request){
+	    	var attr = Object.keys(request.query)[0];
+	    	request.serverQuery = dojo.toJson({ 
+		    						query: 
+		    						{
+		    							query_string: 
+		    							{
+		    								default_field: attr, 
+		    								query: request.query[attr]
+		    							}
+		    						}
+		    					});
+		    // Call superclasses' fetch
+		    return this.inherited("fetch", arguments);
+		  },
+		_fetchItems: function(request, fetchHandler, errorHandler){
+			var serverQuery = request.serverQuery;
+			var xhrHandler = dojo.xhrPost( { url:this.url,
+								handleAs: "json",
+								postData: serverQuery });
+			request.abort = function(){
+				xhrHandler.cancel();
+			};
+			xhrHandler.addCallback(dojo.hitch(this, function(data){
+				this._xhrFetchHandler(data, request, fetchHandler, errorHandler);
+			}));
+			xhrHandler.addErrback(function(error){
+				errorHandler(error, request);
+			});
+		},
+		_xhrFetchHandler: function(data, request, fetchHandler, errorHandler) {
+			data = this._filterResponse(data);
+			this._items = [];
+			var numHits = data.hits.total || -1;
+			if(numHits > 0) {
+				this._items.push({i:data.hits.hits[0]._source, r:this, n:0});
 			}
-			var self = this;
-		
-			var _errorHandler = function(errorData, requestObject){
-				if(requestObject.onError){
-					var scope = requestObject.scope || dojo.global;
-					requestObject.onError.call(scope, errorData, requestObject);
-				}
-			};
-		
-			var _fetchHandler = function(items, requestObject, numRows){
-				var oldAbortFunction = requestObject.abort || null;
-				var aborted = false;
-				
-				var startIndex = requestObject.start?requestObject.start:0;
-				if(self.doClientPaging == false){
-					// For client paging we dont need no slicing of the result.
-					startIndex = 0;
-				}
-				var endIndex = requestObject.count?(startIndex + requestObject.count):items.length;
-		
-				requestObject.abort = function(){
-					aborted = true;
-					if(oldAbortFunction){
-						oldAbortFunction.call(requestObject);
-					}
-				};
-		
-				var scope = requestObject.scope || dojo.global;
-				if(!requestObject.store){
-					requestObject.store = self;
-				}
-				if(requestObject.onBegin){
-					requestObject.onBegin.call(scope, numRows, requestObject);
-				}
-				if(requestObject.sort && self.doClientSorting){
-					items.sort(dojo.data.util.sorter.createSortFunction(requestObject.sort, self));
-				}
-				if(requestObject.onItem){
-					for(var i = startIndex; (i < items.length) && (i < endIndex); ++i){
-						var item = items[i];
-						if(!aborted){
-							requestObject.onItem.call(scope, item, requestObject);
-						}
-					}
-				}
-				if(requestObject.onComplete && !aborted){
-					var subset = null;
-					if(!requestObject.onItem){
-						subset = items.slice(startIndex, endIndex);
-					}
-					requestObject.onComplete.call(scope, subset, requestObject);
-				}
-			};
-			this._fetchItems(request, _fetchHandler, _errorHandler);
-			return request;	// Object
-		},
+			fetchHandler(this._items, request, data.hits.total);
+			this._numRows = data.hits.total;
+		}
 	});
 })
Index: Dev/branches/rest-dojo-ui/client/rft/elastic/ElasticSearchFilteringSelect.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/elastic/ElasticSearchFilteringSelect.js	(revision 367)
+++ Dev/branches/rest-dojo-ui/client/rft/elastic/ElasticSearchFilteringSelect.js	(revision 367)
@@ -0,0 +1,19 @@
+define(["dojo"], function(dojo) {
+	dojo.provide("rft.elastic.ElasticSearchFilteringSelect");
+
+	dojo.require("dijit.form.FilteringSelect");
+
+	dojo.declare("rft.elastic.ElasticSearchFilteringSelect", dijit.form.FilteringSelect, {
+	     // custom min input character count to trigger search
+         minKeyCount: 3,
+
+         // override search method, count the input length
+         _startSearch: function (/*String*/key) {
+             if (!key || key.length < this.minKeyCount) {
+                 this.closeDropDown();
+                 return;
+             }
+             this.inherited(arguments);
+         }
+	});
+})
Index: Dev/branches/rest-dojo-ui/client/rft/pages/session.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/session.js	(revision 366)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/session.js	(revision 367)
@@ -3,5 +3,5 @@
 	'dojo/_base/event',
 	'dojo/_base/Deferred',
-    'dijit/form/FilteringSelect',
+    'rft/elastic/ElasticSearchFilteringSelect',
     'rft/elastic/ElasticReadStore',
 	'rft/store',
@@ -10,8 +10,9 @@
     'rft/ui/AccountListView'
     ],
-	function(declare,lang,event,Deferred,FilteringSelect,ElasticReadStore,store,_Page,content,AccountListView){
+	function(declare,lang,event,Deferred,ElasticSearchFilteringSelect,ElasticReadStore,store,_Page,content,AccountListView){
 		return declare('rft.pages.session',[_Page],{
 			session: null,
-			listView: null,
+			_listView: null,
+            _select: null,
 			onVisit: function() {
 				if ( this.pageArgs.uid ) {
@@ -35,6 +36,6 @@
             },
             onInvite: function() {
-                this._addAccount({ title : this.accountBox.get('value') });
-                this.accountBox.set('value', "");
+                this._addAccount({ title : this._select.displayedValue });
+                this._select.reset();
             },
             onSave: function(evt) {
@@ -54,11 +55,11 @@
             },
             _addAccount: function(item) {
-                this.listView.insertItem(item);
+                this._listView.insertItem(item);
             },
             _setupListView: function() {
-                this.listView = new AccountListView( {
+                this._listView = new AccountListView( {
                     controller: this
                 }).placeAt(this.listViewNode);
-                this.listView.startup();
+                this._listView.startup();
             },
             _setupAutoComplete: function() {
@@ -68,9 +69,9 @@
                     requestMethod: "POST"
                 });
-                var accountText = new FilteringSelect({
+                this._select = new ElasticSearchFilteringSelect({
                     name: "accountBox",
                     store: accountStore,
                     autoComplete: false,
-                    required: true,
+                    required: false,
                     labelType: "text",
                     placeHolder: "Enter email address here...",
@@ -81,5 +82,5 @@
                     id: "accountText"
                 }, "accountBox");
-                accountText.startup();
+                this._select.startup();
             }
 
Index: Dev/branches/rest-dojo-ui/client/rft/ui/MenuLink.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/MenuLink.js	(revision 366)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/MenuLink.js	(revision 367)
@@ -6,5 +6,4 @@
         },
         onClick: function(){
-            debugger;
             content.goTo(this.pageId);
         }
Index: Dev/branches/rest-dojo-ui/client/rft/ui/_Page.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/_Page.js	(revision 366)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/_Page.js	(revision 367)
@@ -36,5 +36,4 @@
             /** Event fired before leaving the page. Return false to prevent */
             onLeave: function(){
-                debugger;
                 dijit.findWidgets(this.domNode).forEach(function(w){
                     w.destroyRecursive(false);
