on 11-16-2017 10:34 PM
My page has a UI5 Grid Table Control and it contains the following columns
Product and Supplier are two different entities which I fetch using different ODATA calls. (/Product and /Supplier) . The Product entity has Supplier ID as a foreign key. How would I display values from these entities in one single Grid Table?
P.S:
Hello,
Redefine you OData model. I mean, create a Parent entity which contain properties :
Then, create two children entities which refer to Product and Supplier. Then create an association (in the both way) for each ID (Product and Supplier).
For instance you Product entity should looks like this :
At the end, the request should looks likes this :
Kind regards,
Joseph
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
easy 🙂
In fact you have 3 entities types but never mind. The point is with expand property you can merge data. Look at this example :
In the view :
<mvc:View controllerName="ch.saphir.demo.expand.Demo_Expand_Table.controller.View1" xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:mvc="sap.ui.core.mvc" displayBlock="true" xmlns="sap.m">
<App id="idAppControl">
<pages>
<Page title="{i18n>title}">
<content>
<Table noDataText="Drop column list items here and columns in the area above" id="__table0"
items="{
path:'/MaterialListSet',
parameters:{expand:'Units'}">
<items>
<ColumnListItem >
<cells>
<Text text="{MatlDesc}"/>
<Text text="{Units/Isotxt}"/>
</cells>
</ColumnListItem>
</items>
<columns>
<Column ><Text text="Material"/></Column>
<Column ><Text text="Unit Text"/></Column>
</columns>
</Table>
</content>
</Page>
</pages>
</App>
</mvc:View
Here Units is the navigation to the text of the Unit Code, and I call the expand in the parameters of the table Items aggregation.
In OData point of view, look at my screenshot :
Regards,
In my point of view it is not more complicated, it is data modeling. Don't forget one thing, if we want to create simple application with Fiori concept, we need absolutely to take care of the data model. In that manner it will be very easy to reuse model and create hudge constellation of simple Fiori elements application combined with Fiori launchpad, you get the right things 😉
combine them to one entity and expose as service
ui control can be bound to n model, but it won't help for your case.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.