0

I have a StandardItemList in UI5 like this

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

How can I achieve getting the description like "Version: ValueOfTheVersion"?

StandardListItem1

When I delete the word "Version" in the description it works very well.

StandardListItem2

Boghyon Hoffmann
  • 17,103
  • 12
  • 72
  • 170
rwur
  • 237
  • 1
  • 6
  • 16

2 Answers2

2

To enable complex binding syntax, the recommended way is to 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.

With the complex binding syntax enabled, we can make use of

Boghyon Hoffmann
  • 17,103
  • 12
  • 72
  • 170
  • 1
    Hi, how to add compatVersion in fiori app, since fiori app did not have index.html, should I put this in component.js? – Tina Chen Nov 27 '17 at 02:08
  • 2
    @Tina The `compatVersion` as well as `(xx-)bindingSyntax` are already supplied by FLP. You can see how FLP configured the bootstrap in *Technical Information* from [Diagnostics](https://ui5.sap.com/#/topic/6ec18e80b0ce47f290bc2645b0cc86e6). Unfortunately, I'm not aware of how to change those config values for FLP and neither component nor its descriptor supports these kind of attributes. Nevertheless, the binding syntax should be already set to `"complex"` in FLP by default. – Boghyon Hoffmann Nov 27 '17 at 09:27
1

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>
rwur
  • 237
  • 1
  • 6
  • 16