Skip to Content
0
Feb 01, 2019 at 06:03 PM

Get value from different hana table of odata model based on a key and display in SAPUI5 table

62 Views

I have table with 4 columns Customer ID,Name, Mobile No, Address and city.

Customer ID,Name, Mobile No come from "{carsModel>/customer}" table of Odata model

I have City code in the City column , I need to display City Name in that column from "{carsModel>/cities}" table of Odata model with the column "{carsModel>CITY_NAME}".

How can I acheive this.

Code for table.

<Table items="{carsModel>/customer}" noDataText="Drop column list items here and columns in the area above" id="table0" alternateRowColors="true">
<items>
<ColumnListItem type="Active" id="item0">
	<cells>
	<Text text="{carsModel>CUSTOMER_ID}" id="text2"/>
	<Text text="{carsModel>CUSTOMER_NAME}" id="text3"/>
	<Text text="{carsModel>MOBILE_NO}" id="text4"/>
	<Text text="{carsModel>CUSTOMER_ADDRESS}" id="text5"/>
	<Text text="{carsModel>CUSTOMER_CITY_ID}" id="text6"/>
									</cells>
							</ColumnListItem>
						</items>
						<columns>
							<Column id="column0">
								<header>
									<Label text="Customer ID" id="label0"/>
								</header>
							</Column>
							<Column id="column1">
								<header>
									<Label text="Name" id="label1"/>
								</header>
							</Column>
							<Column id="column2">
								<header>
									<Label text="Mobile No" id="label2"/>
								</header>
							</Column>
								<Column id="column3">
								<header>
									<Label text="Address" id="label3"/>
								</header>
							</Column>
									<Column id="column4">
								<header>
									<Label text="City" id="label4"/>
								</header>
							</Column>
						</columns>
					</Table>

I need to get values