Skip to content

Commit

Permalink
Merge pull request #70 from schlak/schlak-patch-1
Browse files Browse the repository at this point in the history
Update property-metadata-binding-f5aa4bb.md
  • Loading branch information
KlattG authored Aug 3, 2023
2 parents 910d40b + 1de4474 commit 8a448ec
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions docs/04_Essentials/property-metadata-binding-f5aa4bb.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)");
```


0 comments on commit 8a448ec

Please sign in to comment.