-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui5x.js
635 lines (553 loc) · 23.7 KB
/
ui5x.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
console.log("ui5x2.js is loaded");
this.ui5x = jQuery.extend((this.ui5x || {}),{
_modLoadHandlers: {},
_checkedModules: {},
addModLoadHandler: function(modName, fnCb){
var modLoadHandlers = this._modLoadHandlers[modName] || (this._modLoadHandlers[modName]=[]);
if(this._checkedModules[modName] || inArray(modName, $.sap.getAllDeclaredModules())){
fnCb();
this._checkedModules[modName] = true;
}
else modLoadHandlers.push(fnCb);
}
});
(function(fn) {
jQuery.sap.require = function(){
var modName = arguments[0].modName || arguments[0];
var toRet = fn.apply(jQuery.sap, arguments);
var loadHandlers = ui5x._modLoadHandlers[modName] || [];
$.each(loadHandlers, function(i,fnCb){
fnCb();
loadHandlers.splice(i,1);
});
return toRet;
}
})(jQuery.sap.require);
/**
* This function serves the as typed typed controllers, but provides allot more, it offers a simple extension mechanism from
* the first object produced by this method. It does not to override constructors and onInit methods, but rather chains them.
* @param sExtName
* @param extImpl
* @param baseName
* @param sType
*/
function ui5extend (sExtName, extImpl, baseName, sType){
sType = sType || baseName.split('.').pop().toLowerCase();
/* boilerplate code for typed Controller */
jQuery.sap.declare(sExtName);
jQuery.sap.declare({modName:sExtName, type:sType}); // declaring a special type of module
// var extension = getObjProperty(window,sExtName,false);
//eval(sExtName+' = function(){'+baseName+'.apply(this, arguments);}');
setProperty(this, function () { // the constructor
getObjProperty(window,baseName,false).apply(this, arguments);
var ctor = getObjProperty(extImpl,'constructor',false);
if(!!ctor){
ctor.apply(this, arguments);
//delete extImpl['constructor'];
}
}, sExtName);
jQuery.sap.require(baseName); // this is currently required, as the Controller is not loaded by default
getObjProperty(window,sExtName,false).prototype = jQuery.sap.newObject(getObjProperty(window,baseName,false).prototype); // chain the prototypes
/* end of boilerplate code for typed Controller */
getObjProperty(window,sExtName,false).extend = function(sExtendingName, oImpl) {
return ui5extend(sExtendingName, oImpl, sExtName);
};
getObjProperty(window,sExtName,false).prototype.onInit = function() {
try{getObjProperty(window,baseName,false).prototype.onInit.apply(this, arguments)}catch(e){}
var onInit = getObjProperty(extImpl, 'onInit', false);
if(!!onInit) onInit.apply(this, arguments);
};
$.each(extImpl, function(key,value){
if(!inArray(key, ['onInit', 'constructor'])) getObjProperty(window, sExtName, false).prototype[key] = value;
});
};
jQuery.sap.require("sap.ui.core.Element");
jQuery.sap.require("sap.ui.model.Model");
/**!!! Element !!!**/
// Need to consult with SAPUI5 on how to make this sound with multi-bound elements, or multiple aggregations
sap.ui.core.Element.prototype.setPropertyFire = function(sPropertyName, oValue, bSuppressInvalidate){
var toReturn = this.setPropertyFire(sPropertyName, oValue, bSuppressInvalidate);
this.fireChange();
};
sap.ui.core.Element.prototype.getContextProperty =
sap.ui.core.Element.prototype.getBoundProperty = function(sPath){
var context = this.getBindingContext();
if(!!context){
return context.oModel.getProperty(context.sPath+(!!sPath? ('/'+sPath): ''));
}
return undefined;
};
sap.ui.core.Element.prototype.bindingProxy = function(){
var oContext = this.getBindingContext();
if(!oContext || !oContext.oModel.proxy) return;
this.__prevBindingContext = oContext; // store for revert
var proxyModel = oContext.oModel.proxy(oContext.sPath);
this.setModel(proxyModel).bindElement('/data');
return this;
};
sap.ui.core.Element.prototype.bindingRevert = function(){
if(!this.__prevBindingContext) return;
this.setModel(this.__prevBindingContext.oModel).bindElement(this.__prevBindingContext.sPath);
delete this.__prevBindingContext;
return this;
};
sap.ui.core.Element.prototype.x_AddUpdateRow = function(oData,sRowBindingPath, sIdProperty){
var model = this.getModel();
sIdProperty = sIdProperty || 'id';
if(!!model){
// If the RowBindingPath was not pass then extract from element binding info
sRowBindingPath = sRowBindingPath || this.x_GetRowsBindingPath();
return model.x_AddUpdateRow(oData, sRowBindingPath);
}else{
jQuery.sap.log.error('Element must have a model to execute function "x_AddUpdateRow"');
}
};
sap.ui.core.Element.prototype.x_SetData = function(oData,sPath, sModelName){
var model = this.x_GetSetModel(sModelName);
if(!!model){
return model.x_SetData(oData, sPath || '');
}else{
jQuery.sap.log.error('Element must have a model to execute function "x_AddUpdateRow"');
}
};
sap.ui.core.Element.prototype.x_GetSetModel = function(modelName){
if(!this.getModel(modelName)){
jQuery.sap.require("sap.ui.model.json.JSONModel");
var jsmodel = new sap.uiext.model.json.JSONModel({});
this.setModel(jsmodel, modelName);
}
return this.getModel(modelName);
};
sap.ui.core.Element.prototype.x_SetJSModel = function(oData, sName){
jQuery.sap.require("sap.ui.model.json.JSONModel");
var jsmodel = new sap.uiext.model.json.JSONModel(oData);
this.setModel(jsmodel, sName);
return this;
};
/**
* Takes a string path or Context object and deletes the branch by the given path in the element's model
* @param {string | Context} context
*/
sap.ui.core.Element.prototype.x_ModelDeleteRow = function(context){
context = sui.getBindingStr(context);
if(isEmpty(context)){
jQuery.sap.log.debug('A context argument must be passed for x_ModelDeleteRow to operate');
return;
}
if(!!this.getModel().removeFrom)
this.getModel().removeFrom(context);
};
sap.ui.core.Element.prototype.x_GetModelRows = function(){
if(this.hasModel()){
var rowsBindPath = this.x_GetRowsBindingPath(),
aggrObj = getFromObjPath(this.getModel().getData(), rowsBindPath, '/');
if(isEmpty(aggrObj)) {
var newArr = new Array();
setToValue(this.getModel().getData(), newArr,rowsBindPath, '/');
return newArr;
}
return aggrObj;
}
jQuery.sap.log.debug("Element must have model to use method x_GetModelRows");
return false;
};
sap.ui.core.Element.prototype.x_GetModelRowByIndex = function(i){
return this.x_GetModelRows()[i];
};
sap.ui.core.Element.prototype.x_BindAggregation = function(aggrgationName, sPath, oTemplate, oSorter, aFilters){
var defaultAggr = aggrgationName ||this.x_GetRecordsAggregation();
var path = sPath || ''; //sPath[0]!='/' && !this.getBindingContext()? '/'+sPath: sPath
var bTemplate = oTemplate || this.x_GetBindingTemplate();
// var bindInfo = {
// path: sPath[0]!='/' && !this.getBindingContext()? '/'+sPath: sPath,
// template: oTemplate || this.x_GetBindingTemplate()
// };
if(!!defaultAggr && !!bTemplate){
this.bindAggregation(defaultAggr, path, bTemplate, oSorter, aFilters);
}
};
sap.ui.core.Element.prototype.x_BindRecordsAggregation = function(sPath, oTemplate, oSorter, aFilters){
var defaultAggr = this.x_GetRecordsAggregation();
if(!!defaultAggr){
this.x_BindAggregation(defaultAggr, sPath, oTemplate, oSorter, aFilters);
}
};
sap.ui.core.Element.prototype.x_GetRecordsAggregation = function(){
if(!!this.getRows)
return "rows";
else if(!!this.getItems)
return "items";
else if(!!this.getContent){
return "content";
}
else{
jQuery.sap.log.debug('The element has no records binding aggregation.');
return null;
}
};
sap.ui.core.Element.prototype.x_GetRecordsBindingPath = function(){
return this.getBindingPath(this.x_GetRecordsAggregation());
};
sap.ui.core.Element.prototype.getBindingSizeLimit = function(){
// defaulted to one hundred as suggested by SAPUI5 team due to that being the default value
// for the library's elements
return this.getModel() && this.getModel().iSizeLimit || 100;
};
sap.ui.core.Element.prototype.x_isRecordBound = function(){
return !isEmpty(this.getBindingPath(this.x_GetRecordsAggregation()));
};
sap.ui.core.Element.prototype.x_GetModelLastRow = function(){
var mRows = this.x_GetModelRows(), mLastIndex = mRows.length-1;
return mRows[mLastIndex];
};
sap.ui.core.Element.prototype.x_GetAggregatingParent = function(){
var parent = this;
while(parent !== this.getUIArea()){
if(!isEmpty(parent.getBindingPath('rows')))
return parent;
parent = parent.getParent()
}
return false;
};
sap.ui.core.Element.prototype.x_GetRowsBindingPath = function(){
var aggrParent = this.x_GetAggregatingParent(), bContext = aggrParent.getBindingContext(),
rBPath = aggrParent.getBindingPath('rows'), patt = new RegExp(bContext);
if(!!bContext && !patt.test(rBPath))
return [bContext, rBPath].join('/');
return rBPath;
};
sap.ui.core.Element.prototype.x_GetBindingTemplate = function(aggr){
var aggr = aggr || this.x_GetRecordsAggregation();
return getFromObjPath(this, 'mBindingInfos.'+aggr+'.template');
};
sap.ui.core.Element.prototype.x_SetBindingTemplate = function(oTemplate, aggregationName){
var aggregationName = aggregationName || this.x_GetRecordsAggregation();
//if(!!getObjProperty(this, 'mBindingInfos.'+aggregationName))
//setToValue(this, oTemplate, 'mBindingInfos.'+aggregationName+'.template');
//this.x_BindingTemplate = oTemplate
this.x_BindAggregation(aggregationName, null, oTemplate);
};
sap.ui.core.Element.prototype.x_GetLabel = function(){
return $('label[for='+this.getId()+']');
};
/**
* returns the label text for this input
* @return {string}
*/
sap.ui.core.Element.prototype.x_GetLabelText = function(){
return this.x_GetLabel().text().replace(/^[\s:]+|[\s:]+$/g,''); // trim and "user:" becomes "user"
};
sap.ui.model.SimpleType.extend("ui5lib.model.BoolInvert", {
formatValue: function(oValue) {
return !oValue;
},
parseValue: function(oValue) {
return !oValue;
},
validateValue: function(oValue) {
if (typeof oValue !== "boolean") {
throw new sap.ui.model.ValidateException("BoolInvert must be boolean");
}
}
});
/**!!! End Element !!!**/
$.sap.require('sap.ui.model.odata.ODataListBinding');
(function(fn){
sap.ui.model.odata.ODataListBinding.prototype.createFilterParams = function(aFilters){
if(!!this._staticFilters)
aFilters = (aFilters||[]).concat(this._staticFilters.concat(getValuesByKeys(this._staticFilters)) || []);
return fn.apply(this, arguments);
};
})(sap.ui.model.odata.ODataListBinding.prototype.createFilterParams);
// removed in favor of hijacking ODataListBinding.prototype.createFilterParams, as it occurs after the aFilters member is updated
/*(function(fn){
sap.ui.model.odata.ODataListBinding.prototype.filter = function(aFilters){
if(!!this._staticFilters)
aFilters = (aFilters||[]).concat(this._staticFilters.concat(getValuesByKeys(this._staticFilters)) || []);
return fn.apply(this, arguments);
};
})(sap.ui.model.odata.ODataListBinding.prototype.filter);*/
/**
* adds static filters to the list binding object that will persist across filter calls
* @param {string} sId? The id for the filter, this way filters can be updated or easily removed
* @param {sap.ui.model.Filter | array} aFilters
* @return {sap.ui.model.ListBinding} returns <code>this</code> to facilitate method chaining
*
* @public
* @name sap.ui.model.odata.ODataListBinding#x_addFilter
* @function
*/
sap.ui.model.odata.ODataListBinding.prototype.x_addFilter= function(sId, aFilters){
if(typeof sId !== 'string'){
if(arguments.length>1){
console.error("sId must be a string");
return;
}
aFilters = sId;
sId = undefined;
}else if(aFilters.length && aFilters.length>1){
console.error("If an sId is assigned, only one filter may be given. Id's may be assigned inside the filters as well");
return;
}
this._staticFilters = this._staticFilters || [];
var that = this;
aFilters = isArray(aFilters)? aFilters: [aFilters];
aFilters.forEach(function(v){
if(!!sId || !!v.id){
that._staticFilters[(sId || v.id)] = v;
delete v.id;
}else{
that._staticFilters.push(v);
}
});
// removed in favor of hijacking ODataListBinding.prototype.createFilterParams, as it occurs after the aFilters member is updated
// removeFromArray(this.aFilters, this._staticFilters.concat(getValuesByKeys(this._staticFilters)));
return this.filter(this.aFilters);
};
/**
* Removes a filter from the binding via filter id or value
* @param {string | sap.ui.model.Filter} filter
* @return {sap.ui.model.ListBinding} returns <code>this</code> to facilitate method chaining
*
* @public
* @name sap.ui.model.odata.ODataListBinding#x_removeFilter
* @function
*/
sap.ui.model.odata.ODataListBinding.prototype.x_removeFilter= function(filter){
if(!this._staticFilters) return;
if(typeof filter === 'string'){
delete this._staticFilters[filter];
}else if(filter instanceof sap.ui.model.Filter){
removeFromArray(this._staticFilters, filter);
}else{
throw new Error("Unrecognized filter type, needs to either id or sap.ui.model.Filter");
}
return this.filter(this.aFilters);
};
sap.ui.model.odata.ODataListBinding.prototype.x_removeAllFilters= function(filter){
this._staticFilters = [];
this.filter();
}
/**
* Adds support to the ODataListBinding type to search on OData service endpoints.
* it does so by building a specialized filter that is later extracted before XHR open and replaced
* with a valid logical contains statement chained by "or" operator.
* @param aFields An array of strings corresponding to the service entity fields to be included in the search
* @param sQuery The search term
* @return {sap.ui.model.ListBinding} returns <code>this</code> to facilitate method chaining
*/
sap.ui.model.odata.ODataListBinding.prototype.x_search = function(aFields, sQuery){
// Add support for search ONCE
if(!sap.ui.model.odata.ODataListBinding.prototype.x_searchSupport){
// Overriding filter on oBinding to check for the search filter before issuing a filter on the binding
/*(function(filter){
sap.ui.model.odata.ODataListBinding.prototype.filter = function(aFilters){
if(!!this.x_searchFilter){
aFilters.push(this.x_searchFilter);
}
return filter.apply(this, arguments);
};
})(sap.ui.model.odata.ODataListBinding.prototype.filter);*/
// Augmenting XHR open to serialize the special search filter from the binding's filter string
(function() {
var proxied = window.XMLHttpRequest.prototype.open;
window.XMLHttpRequest.prototype.open = function() {
if(arguments[1].search(/__SEARCHFILTER__/mg)>-1){
var matches = /__SEARCHFILTER__(.*?)__SEARCHFILTER__%20eq%20'?([a-z,A-Z,0-9, ,-,]+)'?/mgi.exec(arguments[1]);
// TODO: make sure there are fields listed in the special search filter
var filterColumns = $.map(matches[1].split('|'), function(v){
return "substringof('"+matches[2]+"',"+v+")";
});
var searchFilterStr = "("+filterColumns.join(" or ")+")";
arguments[1] = arguments[1].replace(matches[0], searchFilterStr);
}
return proxied.apply(this, arguments);
};
})();
sap.ui.model.odata.ODataListBinding.prototype.x_searchSupport = true;
}
var aFilters = this.aFilters;
//var aSorters = this.aSorters;
// clear out the search filter
/*aFilters = $.grep(aFilters, function(v){ if (v.sPath.search(/__/)<0) return true; });
this.x_searchFilter= null;*/
if(!!sQuery) { // add the special search filter to be serialized on xhr open
/*this.x_searchFilter =*/
var searchFilter = new sap.ui.model.Filter('__SEARCHFILTER__' + aFields.join('|') + '__SEARCHFILTER__', 'EQ', sQuery);
searchFilter.id = "__SEARCHFILTER__";
this.x_addFilter(searchFilter);
}else{
this.x_removeFilter("__SEARCHFILTER__");
}
return this/*.sort(aSorters)*/.filter(aFilters);
};
/**!!! JSON Model !!!**/
sap.ui.model.Model.prototype.x_SetData = function(dataObj, sPath, bMerge){
var oData = this.getData() || {};
var dataClone = clone(dataObj);
if(!isEmpty(sPath))
setProperty(oData, dataClone, sPath, '/'); // this provides mirroring where as the merge supplied by SUI5 only supplies updating
else
oData = dataClone;
if(arguments.length>2) this.setData(oData, bMerge);
else this.setData(oData);
this.checkUpdate();
};
/**
*
* @param oData the data object to write to the model
* @param sRowsBindPath the row binding path from the requesting UI element
* @param sIdProperty the identifying property of the oData object
* @return {int} number of rows in the row binding path
*/
sap.ui.model.Model.prototype.x_AddUpdateRow = function(oData, sRowsBindPath, sIdProperty){
sIdProperty = sIdProperty || 'id';
if(!sRowsBindPath){
jQuery.sap.log.error('An sPath or sRowBindPath must be provided to model.x_AddUpdateRow"');
return -1;
}
var modelRows = this.getProperty(sRowsBindPath), modelRowsLen;
if(!modelRows){
var mData={};
setToValue(mData,[oData],sRowsBindPath, '/');
this.setData(mData);
modelRows = this.getProperty(sRowsBindPath);
}
modelRowsLen = modelRows.length;
var objIndex = !!oData[sIdProperty]? indexOfKeyValue(modelRows, sIdProperty, oData[sIdProperty]): -1;
// if objIndex>-1 oData was found and this is an add operation, otherwise it is an update operation
var sPath = sRowsBindPath + '/' + (objIndex>-1? objIndex: modelRowsLen);
this.x_SetData(oData, sPath);
// return row count
return (objIndex>-1? modelRowsLen: modelRowsLen+1);
};
/**!!! END JSON Model !!!**/
/**!!! Start Framework Fiddling !!!**/
// The following 3 closures are required to fix the model inheritance tree for fragments and fragment-dialogs (sadly these lie in different branches currently)
ui5x.addModLoadHandler("sap.ui.model.json.JSONModel", function() {
sap.ui.model.json.JSONModel.extend("sap.uiext.model.json.JSONModel", {
metadata:{
events: {
"propertyChange":{}
}
},
addRevision: function(key){
var oData = clone(this.getData());
this.__revisions = this.__revisions || [];
if(!!key){
if(typeof key === "string"){}
else key = btoa(JSON.stringify(key)); // convert type to reconstructable key
this.__revisions[key] = oData;
}else{
this.__revisions.push(oData);
}
},
restoreRevision: function(key){
if(!this.__revisions) return undefined;
var oData = !!key?
(
typeof key === "string"?
this.__revisions[key]:
this.__revisions[btoa(JSON.stringify(key))]
):
this.__revisions.pop();
if(!isEmpty(oData)) this.setData(oData);
},
validateInput: function(notify){
if(!isEmpty(getObjProperty(this, 'validation_errors'))){
if(!!notify){
var messages = [];
for(var errElem in this.validation_errors){
// TODO?: make inner loop to display messages for elements
messages.push(this.validation_errors[errElem].messages[0]);
}
if(!!sui) sui.input_validation.alert(messages);
}
return false;
}
return true;
},
/**
*
* @param sPath Absolute path inside the oData member of the model or the object passed through "oContext" param
* @param oValue Value to write to sPath in the model object
* @param oContext [optional]
* @returns {*|void|sap.ui.base.ManagedObject|boolean|sap.uiext.model.json.JSONModel}
*/
setProperty: function(sPath, oValue, oContext){
var ret;
if(!/^\//.test(arguments[0])){
arguments[0] = '/'+arguments[0];
}
// Create path if it does not exist
propertyGetSet(parentPath(sPath), this.oData, '/');
ret = sap.ui.model.json.JSONModel.prototype.setProperty.apply(this, arguments);
this.fireEvent('propertyChange', {sPath:sPath, oValue:oValue, oContext:oContext});
return ret;
},
/**
* the path to the property
* @param {String | Object} sPath
* @param {String | Object} [oContext]
* @return {Object}
*/
setData: function(){
sap.ui.model.json.JSONModel.prototype.setData.apply(this, arguments);
this.fireEvent('propertyChange', {sPath:'', oValue:arguments[0], oContext:'/'});
},
/**
* Creates a subset of the model which is a proxy of it, changes will not affect the original model
* unless commitChanges as been called on the proxy
*/
proxy: function(sPath){
var proxiedValue = this.getProperty(sPath||'/');
var proxyModel = new sap.uiext.model.json.JSONModel({data:clone(proxiedValue)});
proxyModel._dataSource = {model: this, path: sPath || '/'};
return proxyModel;
},
revert: function(){
var dataSrc = this.getDataSource();
var srcModel = dataSrc.model;
if(!!srcModel){
this.setProperty('data', clone(srcModel.getProperty(dataSrc.path)));
}
},
getDataSource: function(){return this._dataSource || {model:undefined, path:undefined};},
commitChanges: function(){
},
removeFrom: function(sPath){
removeObjProperty(this.getData(),sPath,'/');
this.checkUpdate();
var delPathArr = sPath.split('/');
var changedPath = delPathArr.slice(0,delPathArr.length-1).join('/');
this.fireEvent('propertyChange', {sPath:changedPath, oValue:null, oContext:'/', bindPath:changedPath});
},
renderer : {} // an empty renderer by convention inherits the parent renderer
});
});
ui5x.addModLoadHandler("sap.ui.core.Fragment", function() {
(function (fn) {
sap.ui.fragment = function () {
var controller = $.grep(arguments, function (v) {
return v instanceof sap.ui.core.mvc.Controller;
})[0];
var fragment = fn.apply(null, arguments);
if (!!controller){
var view = controller.getView();
view.addDependent(fragment); // fix fragment inheritance
if(!!fragment._dialog) view.addDependent(fragment._dialog); // fix fragment-dialog inheritance
}
return fragment;
}
}(sap.ui.fragment));
});
/*
ui5x.addModLoadHandler("sap.ui.model.Context", function() {
(function (fn) {
sap.ui.model.Context = function () {
debugger;
return fn;
}
}(sap.ui.model.Context));
});
*/