Skip to Content
avatar image
Former Member

UI5 oData Binding

Hello,

I'm currently at a point where I dont get, how I can get on.

I have some code like this:

Could someone explain me in detail how I can use two different Entity Sets within one Page?

Many thanks in advance

Best regards

Johannes

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Jul 20, 2017 at 07:13 AM

    Entity is like a data set which holds the values in variables/properties. You first say that which is the dataset i.e. entity for the table. Then, bind the properties in that entity to the columns or rows in the table. In a view XML, you can map only one entity set for a control.

    If you want to use data from multiple entities, then you have to manually set the properties to the controls in the table.

    Regards,

    Sharath

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      i got the issue solved today. Thank you a lot for your patience and answers.

      The reason was that there was no navigation property/association between the detaildata and the masterlist data in the oData Service. I got it this morning.

      Best regards

      Johannes

  • Jul 20, 2017 at 06:00 AM

    I can see that in the Table with id incidentList you are binding fields from the entity set 2, but where have you bound the entity set 2 with the table? Without providing a binding path to the required entity set in the table it is not possible to bind fields from the entity set inside the cells of the table.

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 25, 2017 at 02:36 AM

    think of the Entities as lists or properties of an object.

    Supposed you have a model which contains a simple property (name), and a complex property (addresses). Think about addresses for a second. Addresses is a list of Address. Further, Address is a complex object itself probably composed of Street, City, State, Country, etc.

    so if you had a list of address, then you would bind your UI list control with the Addresses (to bind the root) and then each Address item could have text properties of the Address properties (Street, City, State, Country), etc.

    (pseudo code for simple explanation)

    <List items="{Addresses}"> <!-- this line binds the list -->

    <ObjectItem>

    <Text text="{Street}, {State}" /> <!-- notice you can also put multiple properties on the same property binding -->

    <Label text="{Country}" />

    </ObjectItem>

    </List>

    hope this helps understand the binding... also, please take a look at the sapui5 explored tab - aggregation binding

    Add comment
    10|10000 characters needed characters exceeded