@@ -429,10 +429,11 @@ sap.ui.define(["jquery.sap.global", "sap/ui/core/ElementMetadata"],
429
429
*
430
430
* @param {Object } model - model can be either a "real" model or a model-context
431
431
* @param {string } path
432
+ * @param {Object } [binding]
432
433
* @returns {Object }
433
434
* @private
434
435
*/
435
- _getModelInfo : function ( model , path ) {
436
+ _getModelInfo : function ( model , path , binding ) {
436
437
if ( ! model ) {
437
438
return null ;
438
439
}
@@ -455,6 +456,7 @@ sap.ui.define(["jquery.sap.global", "sap/ui/core/ElementMetadata"],
455
456
var pathWithoutModel = pathContainsModelName ? pathParts [ 1 ] : pathParts [ 0 ] ;
456
457
var isRelative = pathWithoutModel . indexOf ( "/" ) !== 0 ;
457
458
var type = model . getMetadata ( ) . getName ( ) ;
459
+ var bindingType = binding && binding . getMetadata ( ) . getName ( ) || "" ;
458
460
var isResourceModel = type === "sap.ui.model.resource.ResourceModel" ;
459
461
var fullPath ;
460
462
var contextPath ;
@@ -483,8 +485,13 @@ sap.ui.define(["jquery.sap.global", "sap/ui/core/ElementMetadata"],
483
485
modelInfo . pathData = path !== context . getPath ( ) ? context . getObject ( path ) : context . getObject ( ) ;
484
486
} else {
485
487
// functions in the model cannot communicated via message
486
- modelInfo . modelData = isResourceModel ? "" : model . getObject ( contextPath || "/" ) ;
487
- modelInfo . pathData = model . getProperty ( fullPath ) ;
488
+ modelInfo . modelData = isResourceModel || type . startsWith ( "sap.ui.model.odata.v4" ) ? "" : model . getObject ( contextPath || "/" ) ;
489
+ if ( bindingType . endsWith ( "ODataListBinding" ) ) {
490
+ // the binding has the data
491
+ modelInfo . pathData = binding . getAllCurrentContexts ( ) . map ( c => c . getObject ( ) ) ;
492
+ } else {
493
+ modelInfo . pathData = model . getProperty ( fullPath ) ;
494
+ }
488
495
}
489
496
modelInfo . fullPath = fullPath ;
490
497
modelInfo . path = pathWithoutModel ;
@@ -512,7 +519,7 @@ sap.ui.define(["jquery.sap.global", "sap/ui/core/ElementMetadata"],
512
519
* @private
513
520
*/
514
521
_getModelInfoFromBinding : function ( binding , bindingInfo ) {
515
- return this . _getModelInfo ( binding . getContext ( ) || binding . getModel ( ) , ( bindingInfo . model ? bindingInfo . model + ">" : "" ) + bindingInfo . path ) ;
522
+ return this . _getModelInfo ( binding . getContext ( ) || binding . getModel ( ) , ( bindingInfo . model ? bindingInfo . model + ">" : "" ) + bindingInfo . path , binding ) ;
516
523
} ,
517
524
518
525
/**
0 commit comments