Skip to content

Commit

Permalink
Update property-metadata-binding-f5aa4bb.md
Browse files Browse the repository at this point in the history
Adds the binding procedure of a property that doesn't occur in the default model
  • Loading branch information
schlak authored Aug 3, 2023
1 parent 910d40b commit 1de4474
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 1de4474

Please sign in to comment.