-1

I am a beginner with SAPUI5, im trying to bind an attribute adding an string before it but i can't get it. I don't know what is wrong any can help me?

var oObjectHeader = new sap.m.ObjectHeader({
            title: "{Name}",
            number: "ID: {ID}",
            attributes: [
                new sap.m.ObjectAttribute({
                    text: "{Address/Country}"
                })
            ]
        });

if i delete the string before the curly brackets this work fine but i don't want to achieve this without the string before.

Is possible to do that? Regards,

Rob
  • 14,746
  • 28
  • 47
  • 65
Ivan Lynch
  • 563
  • 5
  • 23

1 Answers1

0

I supose you mean your binding to the property "number" is not working, but the one on the property "title" is working? It should work either with a string or without, but well, you could try separating the string like this:

number: "ID: " + "{ID}",

It works for me on both cases.

Hope it works for you too!

  • Separating does not help. The OP is actually missing the bootstrap config `compatVersion="edge"` or `bindingSyntax="complex"` which enables complex binding syntax support as described in here: https://stackoverflow.com/a/41554735/5846045 – Boghyon Hoffmann Dec 01 '17 at 21:39
  • Well, thank you, didn't know about that so I've just learnt something :) – Gerard Fandos Dec 04 '17 at 12:48