From 1de4474129a9caebe1934e1e64bd284cdf2232c2 Mon Sep 17 00:00:00 2001 From: schlak Date: Thu, 3 Aug 2023 11:29:08 +0200 Subject: [PATCH] Update property-metadata-binding-f5aa4bb.md Adds the binding procedure of a property that doesn't occur in the default model --- .../property-metadata-binding-f5aa4bb.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/04_Essentials/property-metadata-binding-f5aa4bb.md b/docs/04_Essentials/property-metadata-binding-f5aa4bb.md index 7aacdebb..b3b05b7b 100644 --- a/docs/04_Essentials/property-metadata-binding-f5aa4bb.md +++ b/docs/04_Essentials/property-metadata-binding-f5aa4bb.md @@ -27,6 +27,18 @@ The binding must then know the metadata part of the binding expression. The path var myLabel = new sap.m.Label({text:"{/#Company/CompanyName/@sap:label}"}); ``` + To use the absolute binding for a property that doesn't occur in a EnttityType of the default model, the reference to the correct model defined in the manifest can be added as a prefix. + If you’re not adding the model the framework will tell you in the development console that the mentioned Entity is not present. + Defining the target model can be done by adding `myModel>` in the beginning of the binding string. + + + Example: + + ```js + + var myLabel = new sap.m.Label({text:"{myModel>/#Company/CompanyName/@sap:label}"}); + ``` + - Relative Binding A relative binding path can be resolved relative to a data path/context. @@ -39,5 +51,3 @@ The binding must then know the metadata part of the binding expression. The path var myLabel2 = new sap.m.Label({text:"{City/#@sap:label}"}); myLabel2.bindElement("/Companies(1)"); ``` - -