Skip to Content
avatar image
Former Member

Element binding by attribute (for example ID) possible?

Hi,

it's possible to bind a view to the data via an index:

this.getView().bindElement("EntitySet>/entity/23");

But it is also possible to bind it to the data via a specific attribute?

Something like this:

this.getView().bindElement("EntitySet>/entity('id=12')";

I think i saw something similar somewhere ...

Would be great! 😊

Regards,

Dominik

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Oct 20, 2015 at 06:16 AM

    Hi Dominik,

    Your syntax is correct and will work.

    Little side note: You don't specify the entityset before the '>', you'll have to specify the model you want to bind to the view (although if you added the model with key 'entitySet', this will work 😊 ). Also refer to SAPUI5 SDK - Demo Kit - Data Binding

    Best regards,

    Maarten

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Maarten Follon

      Hi Maarten,

      in case of testing/building my UI I use JSONmodel from a .json file.

      Later I want to replace it with ODataModel received from NW Gateway.

      Regards,

      Dominik

  • avatar image
    Former Member
    Oct 20, 2015 at 02:31 PM

    Ok, because I haven't solved it I've now rebuilt my application and split the data into two models.

    One with the actual data that i want to display and a second (if requested) with the other data.

    Add comment
    10|10000 characters needed characters exceeded