Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndré Wegmüller2018-03-19 11:31:55 +0000
committerAndré Wegmüller2018-03-19 11:31:55 +0000
commit51455d9a348f196ed23e98d02b9523b0847bcd28 (patch)
tree5f49d7769bb4206d96421b10942936484b6053d8
parente0d444a9916943ab639b973683fc829094d5197c (diff)
downloadorg.eclipse.scout.rt-51455d9a348f196ed23e98d02b9523b0847bcd28.tar.gz
org.eclipse.scout.rt-51455d9a348f196ed23e98d02b9523b0847bcd28.tar.xz
org.eclipse.scout.rt-51455d9a348f196ed23e98d02b9523b0847bcd28.zip
Fix for problem with ProposalField that doesn't store value
When a user entered a text not available in the proposals from the lookup and the user waited a bit (until lookup is done) and then clicks into another field (=acceptInput) the current display text was not set as new value. This problem was introduced with bugfix 221944. 224518
-rw-r--r--org.eclipse.scout.rt.ui.html/src/main/js/scout/form/fields/smartfield2/ProposalField2.js8
-rw-r--r--org.eclipse.scout.rt.ui.html/src/main/js/scout/form/fields/smartfield2/SmartField2.js6
2 files changed, 13 insertions, 1 deletions
diff --git a/org.eclipse.scout.rt.ui.html/src/main/js/scout/form/fields/smartfield2/ProposalField2.js b/org.eclipse.scout.rt.ui.html/src/main/js/scout/form/fields/smartfield2/ProposalField2.js
index 981d5f63e7..7b6c8c612e 100644
--- a/org.eclipse.scout.rt.ui.html/src/main/js/scout/form/fields/smartfield2/ProposalField2.js
+++ b/org.eclipse.scout.rt.ui.html/src/main/js/scout/form/fields/smartfield2/ProposalField2.js
@@ -101,6 +101,14 @@ scout.ProposalField2.prototype._acceptByTextDone = function(result) {
this._customTextAccepted(result.searchText);
};
+scout.ProposalField2.prototype._checkResetLookupRow = function(searchTextChanged) {
+ return this._userWasTyping;
+};
+
+scout.ProposalField2.prototype._checkSearchTextChanged = function(searchText) {
+ return this._checkDisplayTextChanged(searchText);
+};
+
scout.ProposalField2.prototype._customTextAccepted = function(searchText) {
this._setLookupRow(null); // only reset property lookup
this._setValue(searchText);
diff --git a/org.eclipse.scout.rt.ui.html/src/main/js/scout/form/fields/smartfield2/SmartField2.js b/org.eclipse.scout.rt.ui.html/src/main/js/scout/form/fields/smartfield2/SmartField2.js
index 29ea9e80c4..3eea95c15e 100644
--- a/org.eclipse.scout.rt.ui.html/src/main/js/scout/form/fields/smartfield2/SmartField2.js
+++ b/org.eclipse.scout.rt.ui.html/src/main/js/scout/form/fields/smartfield2/SmartField2.js
@@ -192,7 +192,7 @@ scout.SmartField2.prototype.acceptInput = function() {
// in case the user has typed something after he has selected a lookup row
// --> ignore the selection.
- if (searchTextChanged) {
+ if (this._checkResetLookupRow(searchTextChanged)) {
selectedLookupRow = null;
}
@@ -211,6 +211,10 @@ scout.SmartField2.prototype.acceptInput = function() {
return this._acceptInput(searchText, searchTextEmpty, searchTextChanged, selectedLookupRow);
};
+scout.SmartField2.prototype._checkResetLookupRow = function(searchTextChanged) {
+ return searchTextChanged;
+};
+
scout.SmartField2.prototype._checkSearchTextChanged = function(searchText) {
var a = scout.strings.nullIfEmpty(this._firstTextLine(searchText));
var b = scout.strings.nullIfEmpty(this._lastSearchText);

Back to the top