@sapui5/sap.suite.ui.generic.template 1.142.7 → 1.142.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/sap/suite/ui/generic/template/.library +1 -1
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/Canvas/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/controller/IappStateHandler.js +2 -1
- package/src/sap/suite/ui/generic/template/ListReport/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/controller/ControllerImplementation.js +2 -2
- package/src/sap/suite/ui/generic/template/ObjectPage/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/QuickCreate/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/QuickView/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/genericUtilities/ControlStateWrapperFactory.js +12 -5
- package/src/sap/suite/ui/generic/template/genericUtilities/controlHelper.js +29 -29
- package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/PreliminaryWrapper.js +83 -76
- package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/SmartVariantManagementWrapper.js +9 -7
- package/src/sap/suite/ui/generic/template/lib/AppComponent.js +1 -1
- package/src/sap/suite/ui/generic/template/lib/navigation/NavigationController.js +1 -1
- package/src/sap/suite/ui/generic/template/library.js +1 -1
package/package.json
CHANGED
|
@@ -223,7 +223,8 @@ sap.ui.define([
|
|
|
223
223
|
var oSmartVariantManagement = oState.oSmartFilterbar.getSmartVariant();
|
|
224
224
|
if (oSmartVariantManagement){
|
|
225
225
|
var oSmartVariantManagementWrapper = oTemplateUtils.oCommonUtils.getControlStateWrapper(oSmartVariantManagement, {
|
|
226
|
-
managedControlWrappers: aPageVariantControlStateWrappers.concat([oSmartFilterBarWrapper])
|
|
226
|
+
managedControlWrappers: aPageVariantControlStateWrappers.concat([oSmartFilterBarWrapper]),
|
|
227
|
+
smartFilterBarWrapper: oSmartFilterBarWrapper
|
|
227
228
|
});
|
|
228
229
|
aControlStateWrappers.push(oSmartVariantManagementWrapper);
|
|
229
230
|
} else {
|
|
@@ -1493,7 +1493,7 @@ sap.ui.define([
|
|
|
1493
1493
|
return null;
|
|
1494
1494
|
}
|
|
1495
1495
|
if (controlHelper.isSmartField(oControl)){ // check whether the SmartField is the correct target for focussing
|
|
1496
|
-
return controlHelper.getSmartFieldIsFocussableForInputPromise(oControl).then(function(bIsFocussable){
|
|
1496
|
+
return controlHelper.getSmartFieldIsFocussableForInputPromise(oControl, true).then(function(bIsFocussable){
|
|
1497
1497
|
return bIsFocussable && oControl; // If the SmartField has turned out to be focussable take it. Otherwise no need to investigate the subtree below it.
|
|
1498
1498
|
});
|
|
1499
1499
|
}
|
|
@@ -1553,7 +1553,7 @@ sap.ui.define([
|
|
|
1553
1553
|
//set the focus on the control passed by application
|
|
1554
1554
|
if (controlHelper.isSmartField(oFocusControl)) {
|
|
1555
1555
|
// check whether the SmartField is the correct target for focussing
|
|
1556
|
-
controlHelper.getSmartFieldIsFocussableForInputPromise(oFocusControl).then(function (bIsFocusable) {
|
|
1556
|
+
controlHelper.getSmartFieldIsFocussableForInputPromise(oFocusControl, true).then(function (bIsFocusable) {
|
|
1557
1557
|
if (bIsFocusable) {
|
|
1558
1558
|
controlHelper.focusUI5Control(oFocusControl);
|
|
1559
1559
|
} else {
|
|
@@ -93,15 +93,16 @@ sap.ui.define([
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
/**
|
|
96
|
-
* Private helper function to create the real wrapper based on
|
|
96
|
+
* Private helper function to create the real wrapper based on type and control.
|
|
97
97
|
* This function is injected into PreliminaryWrapper and not exposed in the factory's public API.
|
|
98
|
+
* Parameters are ordered to allow using .bind() for partial application.
|
|
98
99
|
*
|
|
99
|
-
* @param {sap.ui.core.Control} oControl - The control instance
|
|
100
100
|
* @param {string} sType - The type of control (e.g., "SmartTable", "SmartChart")
|
|
101
101
|
* @param {object} [mParams] - Additional parameters passed to constructor of wrapper
|
|
102
|
+
* @param {sap.ui.core.Control} oControl - The control instance (last to enable .bind())
|
|
102
103
|
* @return {object} The real wrapper object for the control with helper methods attached
|
|
103
104
|
*/
|
|
104
|
-
function fnCreateRealWrapper(
|
|
105
|
+
function fnCreateRealWrapper(sType, mParams, oControl) {
|
|
105
106
|
var oWrapper;
|
|
106
107
|
switch (sType) {
|
|
107
108
|
case "SmartFilterBar":
|
|
@@ -190,8 +191,11 @@ sap.ui.define([
|
|
|
190
191
|
return oDummyWrapper;
|
|
191
192
|
}
|
|
192
193
|
|
|
194
|
+
// Create bound function with type and params, leaving oControl to be provided later
|
|
195
|
+
var fnBoundCreator = fnCreateRealWrapper.bind(null, sType, mParams);
|
|
196
|
+
|
|
193
197
|
// Always create a PreliminaryWrapper
|
|
194
|
-
var oPreliminaryWrapper = new PreliminaryWrapper(sId,
|
|
198
|
+
var oPreliminaryWrapper = new PreliminaryWrapper(sId, fnBoundCreator);
|
|
195
199
|
|
|
196
200
|
// Since control is available, immediately set it
|
|
197
201
|
oPreliminaryWrapper.setControl(oControl);
|
|
@@ -225,8 +229,11 @@ sap.ui.define([
|
|
|
225
229
|
}
|
|
226
230
|
var sId = oController.getView().getLocalId(sControlId);
|
|
227
231
|
if (!mWrappers[sId]) {
|
|
232
|
+
// Create bound function with type and params, leaving oControl to be provided later
|
|
233
|
+
var fnBoundCreator = fnCreateRealWrapper.bind(null, sControlType, mParams);
|
|
234
|
+
|
|
228
235
|
// Create a PreliminaryWrapper (control will be set later)
|
|
229
|
-
var oPreliminaryWrapper = new PreliminaryWrapper(sId,
|
|
236
|
+
var oPreliminaryWrapper = new PreliminaryWrapper(sId, fnBoundCreator);
|
|
230
237
|
|
|
231
238
|
mWrappers[sId] = oPreliminaryWrapper;
|
|
232
239
|
}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
sap.ui.define([
|
|
2
|
-
"sap/ui/dom/getFirstEditableInput",
|
|
2
|
+
"sap/ui/dom/getFirstEditableInput",
|
|
3
3
|
"sap/suite/ui/generic/template/genericUtilities/FeLogger",
|
|
4
4
|
"sap/ui/core/Element",
|
|
5
5
|
"sap/ui/table/plugins/MultiSelectionPlugin"
|
|
6
6
|
], function(getFirstEditableInput, FeLogger, Element, MultiSelectionPlugin) {
|
|
7
7
|
"use strict";
|
|
8
|
-
|
|
8
|
+
|
|
9
9
|
var oFeLogger = new FeLogger("genericUtilities.controlHelper");
|
|
10
10
|
var oLogger = oFeLogger.getLogger();
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
var byId = Element.getElementById;
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
function isControlOfType(sPathToType, oControl){
|
|
15
15
|
var FNClass = sap.ui.require(sPathToType);
|
|
16
16
|
return typeof FNClass === "function" && (oControl instanceof FNClass);
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
|
|
19
19
|
function getUI5ControlForDomElement(oDom){
|
|
20
20
|
for (; oDom; oDom = oDom.parentNode) {
|
|
21
21
|
if (oDom.hasAttribute && oDom.hasAttribute("data-sap-ui")) {
|
|
22
22
|
return byId(oDom.id);
|
|
23
23
|
}
|
|
24
|
-
}
|
|
24
|
+
}
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
|
|
27
27
|
function focusUI5Control(oControl, oFocusInfo){
|
|
28
28
|
if (oControl && oControl.focus) {
|
|
29
29
|
oLogger.debug("Set focus on control with id " + oControl.getId());
|
|
@@ -52,9 +52,9 @@ sap.ui.define([
|
|
|
52
52
|
if (oTest !== oControl){
|
|
53
53
|
oLogger.warning(oCurrentFocus ? ("Focus is now on control with id " + oCurrentFocus.getId()) : "There is no focus now");
|
|
54
54
|
}
|
|
55
|
-
}
|
|
55
|
+
}
|
|
56
56
|
}
|
|
57
|
-
|
|
57
|
+
|
|
58
58
|
function focusDom(oDom, oFocusInfo){
|
|
59
59
|
var oUi5Control = getUI5ControlForDomElement(oDom);
|
|
60
60
|
focusUI5Control(oUi5Control, oFocusInfo);
|
|
@@ -66,12 +66,12 @@ sap.ui.define([
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
// returns a Promise that resolves to the boolean information whether the SmartField is a possible focus target for input.
|
|
69
|
-
function getSmartFieldIsFocussableForInputPromise(oSmartField) {
|
|
69
|
+
function getSmartFieldIsFocussableForInputPromise(oSmartField, isSmartForm) {
|
|
70
70
|
return oSmartField._getComputedMetadata().then(function () {
|
|
71
71
|
return (oSmartField.getMode() === "edit") && (oSmartField._getICRenderedPromise() || Promise.resolve());
|
|
72
72
|
}).then(function () {
|
|
73
|
-
var oFirstFocusableInput = !oSmartField._bEdmBoolDetected && getFirstEditableInput(oSmartField.getDomRef());
|
|
74
|
-
return !(!oFirstFocusableInput || oFirstFocusableInput.type === "checkbox");
|
|
73
|
+
var oFirstFocusableInput = (!oSmartField._bEdmBoolDetected || isSmartForm) && getFirstEditableInput(oSmartField.getDomRef());
|
|
74
|
+
return !(!oFirstFocusableInput || (oFirstFocusableInput.type === "checkbox" && !isSmartForm));
|
|
75
75
|
}).catch(function () {
|
|
76
76
|
return false;
|
|
77
77
|
});
|
|
@@ -82,12 +82,12 @@ sap.ui.define([
|
|
|
82
82
|
function getControlWithFocus(){
|
|
83
83
|
return getUI5ControlForDomElement(document.activeElement);
|
|
84
84
|
}
|
|
85
|
-
|
|
85
|
+
|
|
86
86
|
// Returns the parent of a given sap.ui.core.Element, but considers that for Components the parent is to be found via the oContainer property.
|
|
87
87
|
function getParent(oElement){
|
|
88
88
|
return oElement.getParent() || oElement.oContainer;
|
|
89
89
|
}
|
|
90
|
-
|
|
90
|
+
|
|
91
91
|
// If oChild is identified to be invisible, null is returned. Otherwise its parent is returned.
|
|
92
92
|
// If the parent does not exist a faulty value is returned.
|
|
93
93
|
// This is a heuristic method.
|
|
@@ -113,7 +113,7 @@ sap.ui.define([
|
|
|
113
113
|
}
|
|
114
114
|
return vRet;
|
|
115
115
|
}
|
|
116
|
-
|
|
116
|
+
|
|
117
117
|
// Return a list of all children of the given control (in the 'correct' order). Only implemented for certain control types.
|
|
118
118
|
// For the other control types it returns null or an empty array depending on bAlwaysReturnAList.
|
|
119
119
|
function getChildren(oControl, bAlwaysReturnAList){
|
|
@@ -127,7 +127,7 @@ sap.ui.define([
|
|
|
127
127
|
return oControl.getBlocks().concat(oControl.getMoreBlocks());
|
|
128
128
|
}
|
|
129
129
|
if (isControlOfType("sap/ui/comp/smartform/Group", oControl)){
|
|
130
|
-
return oControl.getFormElements();
|
|
130
|
+
return oControl.getFormElements();
|
|
131
131
|
}
|
|
132
132
|
if (isControlOfType("sap/ui/table/Column", oControl)){
|
|
133
133
|
var aRet = oControl.getMultiLabels();
|
|
@@ -135,11 +135,11 @@ sap.ui.define([
|
|
|
135
135
|
if (oLabel){
|
|
136
136
|
aRet.push(oLabel);
|
|
137
137
|
}
|
|
138
|
-
return aRet;
|
|
139
|
-
}
|
|
138
|
+
return aRet;
|
|
139
|
+
}
|
|
140
140
|
return bAlwaysReturnAList ? [] : null;
|
|
141
141
|
}
|
|
142
|
-
|
|
142
|
+
|
|
143
143
|
// Sorter that compares the position of two child controls which have a common parent.
|
|
144
144
|
// Returns a positive integer when oChild1 is larger, a negative number if oChild2 is larger, and 0 if they are identical.
|
|
145
145
|
// Depends on getChildren() being implemented for commonParent. If this is not the case, at least a reproducable order is guaranteed.
|
|
@@ -160,13 +160,13 @@ sap.ui.define([
|
|
|
160
160
|
}
|
|
161
161
|
if (iPositionCompare & Node.DOCUMENT_POSITION_FOLLOWING){
|
|
162
162
|
return -1;
|
|
163
|
-
}
|
|
163
|
+
}
|
|
164
164
|
}
|
|
165
165
|
return 1 - 2 * (!oDomRef1 === !oDomRef2 ? oChild1.getId() < oChild2.getId() : !oDomRef2); // if we cannot determine a reasonable order we still want to have a reproducable order. Note that elements with DomRef must clearly be separated from those without.
|
|
166
166
|
}
|
|
167
167
|
return (iPos1 >= 0 && iPos2 >= 0) ? (iPos1 - iPos2) : (iPos2 - iPos1); // if only one child has been identified in the list of children it takes precedence.
|
|
168
168
|
}
|
|
169
|
-
|
|
169
|
+
|
|
170
170
|
// This function defines which instances of sap.ui.core.Element are relevant for investigation (Currently used in fnSearchInTree).
|
|
171
171
|
// They must posess a property 'visible' (which is guaranteed for all instances of sap.ui.core.Control) which is true.
|
|
172
172
|
// If they have a property 'enabled' this must be true as well.
|
|
@@ -176,7 +176,7 @@ sap.ui.define([
|
|
|
176
176
|
return checkForRelevance(oCell);
|
|
177
177
|
}) : (typeof oElement.getVisible === "function" && oElement.getVisible() && (typeof oElement.getEnabled !== "function" || oElement.getEnabled()));
|
|
178
178
|
}
|
|
179
|
-
|
|
179
|
+
|
|
180
180
|
// This function allows a depth-first search in an element tree starting with root oElement
|
|
181
181
|
// Thereby, the following logic is applied
|
|
182
182
|
// - Children of an element are determined by function getChildren in this class. If this provides an empty array method findElements of the element is used
|
|
@@ -188,14 +188,14 @@ sap.ui.define([
|
|
|
188
188
|
// Note that mAlreadyAnalyzed will be updated by this function
|
|
189
189
|
// fnHandleElement(oElement) is a function that will be called on all relevant elements of the tree.
|
|
190
190
|
// This function can work asynchronously (i.e. return a Promise) or synchronously (i.e. return something which is not a Promise) on a case-by-case basis.
|
|
191
|
-
// In the second case the return value will be considered as the result of the function. In the first case the value the Promise resolves to will be considered as the result.
|
|
191
|
+
// In the second case the return value will be considered as the result of the function. In the first case the value the Promise resolves to will be considered as the result.
|
|
192
192
|
// If the result is a truthy value for one element this value is considered as the result of fnSearchInTree and the processing is stopped.
|
|
193
193
|
// fnSearchInTree returns this result synchronously if all calls of fnHandleElement which have been performed until then have worked synchronously.
|
|
194
194
|
// If the result of fnHandleElement is faulty the depth-first search of the tree proceeds. Thereby the processing of the subtree of oElement is
|
|
195
195
|
// skipped if the result was exactly false. For other faulty values the subtree will be processed next.
|
|
196
196
|
// Note that this process will never work on two elements in parallel. If the processing of one element is asynchronous the process is interrupted until
|
|
197
197
|
// the result of this step is available. Only then the next element will be analyzed.
|
|
198
|
-
// If fnHandleElement never results in a truthy value then fnSearchInTree results in null.
|
|
198
|
+
// If fnHandleElement never results in a truthy value then fnSearchInTree results in null.
|
|
199
199
|
function fnSearchInTree(mAlreadyAnalyzed, oElement, fnHandleElement){
|
|
200
200
|
mAlreadyAnalyzed = mAlreadyAnalyzed || Object.create(null);
|
|
201
201
|
var sId = oElement.getId();
|
|
@@ -213,7 +213,7 @@ sap.ui.define([
|
|
|
213
213
|
if (!aChildren){ // if getChildren does not care for the control type of oElement
|
|
214
214
|
aChildren = oElement.findElements(false);
|
|
215
215
|
aChildren.sort(fnSortChildControls.bind(null, oElement));
|
|
216
|
-
}
|
|
216
|
+
}
|
|
217
217
|
aChildren.some(function(oChild){
|
|
218
218
|
vResult = fnSearchInTree(mAlreadyAnalyzed, oChild, fnHandleElement);
|
|
219
219
|
return vResult; // If vResult is truthy it is either a Promise (which makes the processing asynchronous) or the result of fnSearchInTree. In both cases we should stop now.
|
|
@@ -233,12 +233,12 @@ sap.ui.define([
|
|
|
233
233
|
}
|
|
234
234
|
// When coming here we have synchronously either found a node with a truthy result or have processed the whole tree without finding any truthy result
|
|
235
235
|
mAlreadyAnalyzed[sId] = 2;
|
|
236
|
-
return vResult || null;
|
|
236
|
+
return vResult || null;
|
|
237
237
|
}
|
|
238
238
|
|
|
239
239
|
/**
|
|
240
240
|
* Returns the selection plugin for the given UI table
|
|
241
|
-
* @param {sap.ui.table.Table} oUiTable
|
|
241
|
+
* @param {sap.ui.table.Table} oUiTable
|
|
242
242
|
* @returns {sap.ui.table.plugins.MultiSelectionPlugin|undefined}
|
|
243
243
|
*/
|
|
244
244
|
function fnGetSelectionPluginForUITable (oUiTable) {
|
|
@@ -286,10 +286,10 @@ sap.ui.define([
|
|
|
286
286
|
searchInTree: fnSearchInTree.bind(null, null),
|
|
287
287
|
getSelectionPluginForUITable: fnGetSelectionPluginForUITable
|
|
288
288
|
};
|
|
289
|
-
|
|
289
|
+
|
|
290
290
|
oControlHelper.isTable = function(oControl){
|
|
291
291
|
return oControlHelper.isSmartTable(oControl) || oControlHelper.isUiTable(oControl) || oControlHelper.isMTable(oControl);
|
|
292
292
|
};
|
|
293
|
-
|
|
293
|
+
|
|
294
294
|
return oControlHelper;
|
|
295
295
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
sap.ui.define([
|
|
2
|
-
|
|
2
|
+
"sap/base/util/extend"
|
|
3
|
+
], function(extend) {
|
|
3
4
|
"use strict";
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -11,13 +12,10 @@ sap.ui.define([
|
|
|
11
12
|
* real wrapper once the control is assigned via setControl().
|
|
12
13
|
*
|
|
13
14
|
* @param {string} sId - The local ID of the control
|
|
14
|
-
* @param {
|
|
15
|
-
* @param {function} fnCreateRealWrapper - Function to create the real wrapper, injected by factory
|
|
16
|
-
* @param {object} oController - The controller instance
|
|
17
|
-
* @param {object} mParams - Additional parameters to pass to the real wrapper constructor
|
|
15
|
+
* @param {function} fnCreateRealWrapper - Function to create the real wrapper, bound with type and params
|
|
18
16
|
* @returns {object} Preliminary wrapper object that will delegate to real wrapper once control is set
|
|
19
17
|
*/
|
|
20
|
-
function PreliminaryWrapper(sId,
|
|
18
|
+
function PreliminaryWrapper(sId, fnCreateRealWrapper) {
|
|
21
19
|
var oLatestState;
|
|
22
20
|
var oRealWrapper;
|
|
23
21
|
var fnResolveRealWrapperReady;
|
|
@@ -25,7 +23,7 @@ sap.ui.define([
|
|
|
25
23
|
fnResolveRealWrapperReady = resolve;
|
|
26
24
|
});
|
|
27
25
|
|
|
28
|
-
|
|
26
|
+
var oPublicInterface = {
|
|
29
27
|
/**
|
|
30
28
|
* Get the current state. Returns stored state before control is set,
|
|
31
29
|
* delegates to real wrapper afterwards.
|
|
@@ -48,55 +46,62 @@ sap.ui.define([
|
|
|
48
46
|
}
|
|
49
47
|
},
|
|
50
48
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Assign the actual control and create the real wrapper.
|
|
51
|
+
* This triggers the creation of the real wrapper, applies any stored state,
|
|
52
|
+
* extends the preliminary wrapper with all methods from the real wrapper,
|
|
53
|
+
* and resolves the promise that queues event handler attachments.
|
|
54
|
+
* @param {sap.ui.core.Control} oControl - The control instance
|
|
55
|
+
*/
|
|
56
|
+
setControl: function(oControl) {
|
|
57
|
+
// Create the real wrapper using bound function (already has type and params bound)
|
|
58
|
+
var oCreatedWrapper = fnCreateRealWrapper(oControl);
|
|
59
|
+
|
|
60
|
+
// Check if wrapper needs time to initialize
|
|
61
|
+
var oWrapperReadyPromise = oCreatedWrapper.oReadyPromise || Promise.resolve();
|
|
62
|
+
|
|
63
|
+
// Wait for wrapper to be ready before setting oRealWrapper
|
|
64
|
+
oWrapperReadyPromise.then(function() {
|
|
65
|
+
oRealWrapper = oCreatedWrapper;
|
|
66
|
+
|
|
67
|
+
// Apply stored state if any
|
|
68
|
+
if (oLatestState !== undefined) {
|
|
69
|
+
oRealWrapper.setState(oLatestState);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Extend the preliminary wrapper with all properties from the real wrapper
|
|
73
|
+
// This makes any additional methods (like setSVMWrapperCallbacks) available
|
|
74
|
+
// The nested extend ensures we keep our proxy methods (getState, setState, etc.)
|
|
75
|
+
// while adding new methods from the real wrapper
|
|
76
|
+
extend(oPublicInterface, extend({}, oRealWrapper, oPublicInterface));
|
|
77
|
+
|
|
78
|
+
// Resolve the promise - this triggers all queued attachStateChanged calls
|
|
79
|
+
fnResolveRealWrapperReady(oRealWrapper);
|
|
80
|
+
});
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Attach a state change handler. Uses promise to queue attachment
|
|
85
|
+
* until the real wrapper is available and ready.
|
|
86
|
+
* @param {function} fnHandler - The event handler function
|
|
87
|
+
*/
|
|
88
|
+
attachStateChanged: function(fnHandler) {
|
|
89
|
+
// Use promise to defer attachment until real wrapper is available and ready
|
|
90
|
+
oRealWrapperReadyPromise.then(function(oWrapper) {
|
|
91
|
+
oWrapper.attachStateChanged(fnHandler);
|
|
92
|
+
});
|
|
93
|
+
},
|
|
72
94
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
attachStateChanged: function(fnHandler) {
|
|
84
|
-
// Use promise to defer attachment until real wrapper is available and ready
|
|
85
|
-
oRealWrapperReadyPromise.then(function(oWrapper) {
|
|
86
|
-
oWrapper.attachStateChanged(fnHandler);
|
|
87
|
-
});
|
|
88
|
-
},
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Detach a state change handler. Forwards to real wrapper once available and ready.
|
|
92
|
-
* @param {function} fnHandler - The event handler function to detach
|
|
93
|
-
*/
|
|
94
|
-
detachStateChanged: function(fnHandler) {
|
|
95
|
-
// Forward to real wrapper once available and ready
|
|
96
|
-
oRealWrapperReadyPromise.then(function(oWrapper) {
|
|
97
|
-
oWrapper.detachStateChanged(fnHandler);
|
|
98
|
-
});
|
|
99
|
-
},
|
|
95
|
+
/**
|
|
96
|
+
* Detach a state change handler. Forwards to real wrapper once available and ready.
|
|
97
|
+
* @param {function} fnHandler - The event handler function to detach
|
|
98
|
+
*/
|
|
99
|
+
detachStateChanged: function(fnHandler) {
|
|
100
|
+
// Forward to real wrapper once available and ready
|
|
101
|
+
oRealWrapperReadyPromise.then(function(oWrapper) {
|
|
102
|
+
oWrapper.detachStateChanged(fnHandler);
|
|
103
|
+
});
|
|
104
|
+
},
|
|
100
105
|
|
|
101
106
|
/**
|
|
102
107
|
* Get the local ID of the control.
|
|
@@ -116,28 +121,30 @@ sap.ui.define([
|
|
|
116
121
|
JSON.stringify(oState) === JSON.stringify(oLatestState);
|
|
117
122
|
},
|
|
118
123
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
124
|
+
/**
|
|
125
|
+
* Called after variant is initialized (for SmartTable/SmartChart wrappers).
|
|
126
|
+
* Delegates to real wrapper once control is set and ready.
|
|
127
|
+
* Note: When this is called, the control always exists (event fired by control),
|
|
128
|
+
* so the promise will already be resolved.
|
|
129
|
+
*/
|
|
130
|
+
onAfterVariantInitialise: function() {
|
|
131
|
+
oRealWrapperReadyPromise.then(function(oWrapper) {
|
|
132
|
+
if (oWrapper.onAfterVariantInitialise) {
|
|
133
|
+
oWrapper.onAfterVariantInitialise();
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
},
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Promise that resolves to the bVMConnection flag value once the real wrapper is ready.
|
|
140
|
+
* This indicates whether the control is connected to page-wide variant management.
|
|
141
|
+
*/
|
|
142
|
+
oVMConnectionPromise: oRealWrapperReadyPromise.then(function(oWrapper) {
|
|
143
|
+
return oWrapper.bVMConnection;
|
|
144
|
+
})
|
|
140
145
|
};
|
|
146
|
+
|
|
147
|
+
return oPublicInterface;
|
|
141
148
|
}
|
|
142
149
|
|
|
143
150
|
return PreliminaryWrapper;
|
|
@@ -9,7 +9,7 @@ sap.ui.define([
|
|
|
9
9
|
* @param {object} oFactory - the controlStateWrapperFactory
|
|
10
10
|
* @param {object} mParams
|
|
11
11
|
* @param {array} mParams.managedControlWrappers - array of controlStateWrappers for controls handled by the SVM
|
|
12
|
-
*
|
|
12
|
+
* @param {object} mParams.smartFilterBarWrapper - explicit reference to SmartFilterBarWrapper for special handling
|
|
13
13
|
* @returns {object}
|
|
14
14
|
*/
|
|
15
15
|
|
|
@@ -53,13 +53,15 @@ sap.ui.define([
|
|
|
53
53
|
});
|
|
54
54
|
});
|
|
55
55
|
|
|
56
|
+
// Get SmartFilterBarWrapper explicitly from params.
|
|
57
|
+
// This connection is needed because SmartFilterBar provides special callbacks to store/restore state
|
|
58
|
+
// for controls that don't have a direct variant management connection (bVMConnection = false), such as:
|
|
59
|
+
// - Extension filters (custom filters added via app or adaptation extensions)
|
|
60
|
+
// - Multiple views state (selected tab in multi-table/chart scenarios)
|
|
61
|
+
// These controls need their state saved/restored with variants via the SFB's beforeVariantFetch/afterVariantLoad events.
|
|
62
|
+
var oSmartFilterBarWrapper = mParams.smartFilterBarWrapper;
|
|
56
63
|
|
|
57
|
-
|
|
58
|
-
var oSmartFilterBarWrapper = mParams.managedControlWrappers.find(function(oWrapper){
|
|
59
|
-
return oWrapper.setSVMWrapperCallbacks;
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
// provide callbacks needed for SFB wrapper to store/restore extension state with variant
|
|
64
|
+
// Provide callbacks needed for SFB wrapper to store/restore extension state with variant
|
|
63
65
|
if (oSmartFilterBarWrapper){
|
|
64
66
|
// Build array with wrapper + bVMConnection info once all wrappers are ready
|
|
65
67
|
Promise.all(mParams.managedControlWrappers.map(function(oWrapper){
|
|
@@ -959,7 +959,7 @@ sap.ui.define([
|
|
|
959
959
|
* @public
|
|
960
960
|
* @extends sap.ui.core.UIComponent
|
|
961
961
|
* @author SAP SE
|
|
962
|
-
* @version 1.142.
|
|
962
|
+
* @version 1.142.9
|
|
963
963
|
* @name sap.suite.ui.generic.template.lib.AppComponent
|
|
964
964
|
*/
|
|
965
965
|
var oAppComponent = UIComponent.extend("sap.suite.ui.generic.template.lib.AppComponent", {
|
|
@@ -3213,7 +3213,7 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
3213
3213
|
* @param {sap.suite.ui.generic.template.lib.AppComponent} oAppComponent The AppComponent instance
|
|
3214
3214
|
* @public
|
|
3215
3215
|
* @extends sap.ui.base.Object
|
|
3216
|
-
* @version 1.142.
|
|
3216
|
+
* @version 1.142.9
|
|
3217
3217
|
* @since 1.30.0
|
|
3218
3218
|
* @alias sap.suite.ui.generic.template.lib.NavigationController
|
|
3219
3219
|
*/
|