Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--eclipse-scout-core/src/form/fields/smartfield/SmartField.js9
-rw-r--r--eclipse-scout-core/src/lookup/LookupCall.js5
-rw-r--r--eclipse-scout-core/src/lookup/StaticLookupCall.js4
3 files changed, 15 insertions, 3 deletions
diff --git a/eclipse-scout-core/src/form/fields/smartfield/SmartField.js b/eclipse-scout-core/src/form/fields/smartfield/SmartField.js
index c86a1f6fbe..98ab80099b 100644
--- a/eclipse-scout-core/src/form/fields/smartfield/SmartField.js
+++ b/eclipse-scout-core/src/form/fields/smartfield/SmartField.js
@@ -587,6 +587,7 @@ export default class SmartField extends ValueField {
_setLookupCall(lookupCall) {
this._setProperty('lookupCall', LookupCall.ensure(lookupCall, this.session));
+ this._syncBrowseMaxRowCountWithLookupCall();
}
_setCodeType(codeType) {
@@ -1290,6 +1291,14 @@ export default class SmartField extends ValueField {
setBrowseMaxRowCount(browseMaxRowCount) {
this.setProperty('browseMaxRowCount', browseMaxRowCount);
+ this._syncBrowseMaxRowCountWithLookupCall();
+ }
+
+ _syncBrowseMaxRowCountWithLookupCall() {
+ if (this.lookupCall) {
+ // sync max rows with lookup call => request one more row to detect if there would be more rows than browseMaxRowCount.
+ this.lookupCall.setMaxRowCount(this.browseMaxRowCount + 1);
+ }
}
setBrowseAutoExpandAll(browseAutoExpandAll) {
diff --git a/eclipse-scout-core/src/lookup/LookupCall.js b/eclipse-scout-core/src/lookup/LookupCall.js
index 96c9834768..d454cadff7 100644
--- a/eclipse-scout-core/src/lookup/LookupCall.js
+++ b/eclipse-scout-core/src/lookup/LookupCall.js
@@ -29,6 +29,7 @@ export default class LookupCall {
this.keys = null; // used on QueryBy.KEYS
this.parentKey = null; // used on QueryBy.REC
this.active = null;
+ this.maxRowCount = 100; // this variable will not be used by the base class but a child class my use it to limit the returned row count
}
init(model) {
@@ -52,6 +53,10 @@ export default class LookupCall {
this.batch = batch;
}
+ setMaxRowCount(maxRowCount) {
+ this.maxRowCount = maxRowCount;
+ }
+
/**
* This method may be called directly on any LookupCall. For the key lookup an internal clone is created automatically.
*
diff --git a/eclipse-scout-core/src/lookup/StaticLookupCall.js b/eclipse-scout-core/src/lookup/StaticLookupCall.js
index 1720a5a62c..017df32996 100644
--- a/eclipse-scout-core/src/lookup/StaticLookupCall.js
+++ b/eclipse-scout-core/src/lookup/StaticLookupCall.js
@@ -32,8 +32,6 @@ export default class StaticLookupCall extends LookupCall {
this.active = true;
}
- static MAX_ROW_COUNT = 100;
-
_init(model) {
super._init(model);
if (!this.data) {
@@ -64,7 +62,7 @@ export default class StaticLookupCall extends LookupCall {
}
_lookupRowsByAll() {
- var datas = this.data.slice(0, StaticLookupCall.MAX_ROW_COUNT + 1);
+ var datas = this.data.slice(0, this.maxRowCount);
return datas
.map(this._dataToLookupRow, this)
.filter(this._filterActiveLookupRow, this);

Back to the top