Code4Life
Code4Life

Reputation: 23

SAPUI5 Data Binding - sap.m.Text

I would like to create a Text like this:

var content = new sap.m.Text({
    text : "{data>/User/Firstname} {data>/User/Lastname}"
})

But the output in the browser is just:

{data>/User/Firstname} {data>/User/Lastname}

Using:

var content = new sap.m.Text({
    text : "{data>/User/Firstname}"
})

works fine.

Upvotes: 0

Views: 3077

Answers (1)

herrlock
herrlock

Reputation: 1454

You need to specify the parameter bindingSyntax in your loading-script and set it to complex [1]

data-sap-ui-xx-bindingSyntax="complex" 

complete tag as example:

<script 
    id="sap-ui-bootstrap" 
    src="/path/to/ui5/resources/sap-ui-core.js" 
    data-sap-ui-theme="sap_bluecrystal" 
    data-sap-ui-xx-bindingSyntax="complex" 
    data-sap-ui-libs="sap.m"></script>

Upvotes: 1

Related Questions