Made search term resilient to UI refresh

This commit is contained in:
Giulio Cesare Solaroli 2015-01-02 17:48:34 +01:00
parent dadca4dfa0
commit 3a34051bb1
2 changed files with 3 additions and 4 deletions

View File

@ -79,7 +79,7 @@ Clipperz.PM.UI.Components.Selections = React.createClass({
React.DOM.form({'className':'searchForm'}, [
React.DOM.div({}, [
React.DOM.label({'htmlFor':'searchValue'}, 'search'),
React.DOM.input({'type':'text', 'id':'searchValue', 'onFocus':this.handleSearchChange, 'onChange':this.handleSearchChange, 'name':'search'})
React.DOM.input({'type':'text', 'id':'searchValue', 'onFocus':this.handleSearchChange, 'onChange':this.handleSearchChange, 'name':'search', 'value':this.props['searchTerm']})
]),
React.DOM.div({}, [ React.DOM.span({'className':'count'}, selectedCardCount) ])
])

View File

@ -496,7 +496,7 @@ console.log("SET USER", aUser);
selectedCardReference: function () {
return this.pages()['mainPage'].props &&
this.pages()['mainPage'].props['selectedCard'] &&
this.pages()['mainPage'].props['selectedCard'] &&
// this.pages()['mainPage'].props['selectedCard'] &&
this.pages()['mainPage'].props['selectedCard']['_reference']
? this.pages()['mainPage'].props['selectedCard']['_reference']
: '';
@ -722,7 +722,6 @@ console.log("SET USER", aUser);
},
runDirectLogin_handler: function (someParameters) {
//console.log("RUN DIRECT LOGIN", someParameters);
var deferredResult;
deferredResult = new Clipperz.Async.Deferred('MainController.runDirectLogin', {trace:false});
@ -1259,7 +1258,6 @@ console.log("SET USER", aUser);
},
search_handler: function (aValue) {
//console.log("SEARCH", aValue);
this.resetCardSelection();
if (aValue == "") {
@ -1268,6 +1266,7 @@ console.log("SET USER", aUser);
this.setFilter('SEARCH', aValue);
}
this.setPageProperties('mainPage', 'searchTerm', aValue);
return this.refreshSelectedCards();
},