rwur
rwur

Reputation: 247

How To Allow Additional Binding Syntax?

I have a StandardListItem with concatenated string literals like this:

new StandardListItem({
  title: "{BOM/#text}",
  description: "Version: " + "{REVISION/#text}"
});

How can I achieve getting the description like "Version: <bound value>"?

StandardListItem1

When I delete the "Version: " + in the description, it works very well.

StandardListItem2

Upvotes: 0

Views: 5642

Answers (2)

Boghyon Hoffmann
Boghyon Hoffmann

Reputation: 18054

To enable complex binding syntax, add the bootstrap configuration option compatVersion with the value "edge". E.g. in index.html:

data-sap-ui-compatVersion="edge"

This replaces the need for sap-ui-xx-bindingSyntax since "edge" sets the binding syntax automatically to "complex". Adding bindingSyntax makes only sense if the compatVersion is lower than "1.28". Options with xx should be avoided anyway because they're experimental.

Complex binding syntax allows:


With UI5 2.x, the above configuration is no longer required.

Upvotes: 2

rwur
rwur

Reputation: 247

Thanks to Rahul!

Adding

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

to the bootstrap in your index.html will do the trick

Full Solution

<script src="/sapui5/resources/sap-ui-core.js"
        id="sap-ui-bootstrap"
        data-sap-ui-xx-bindingSyntax="complex"
        data-sap-ui-libs="sap.m,sap.ui.layout,sap.ui.commons,sap.ui.table"
        data-sap-ui-theme="sap_bluecrystal">
</script>

Upvotes: 1

Related Questions