cancel
Showing results for 
Search instead for 
Did you mean: 

How to read data from oData service by passing Id(employeeID) in XML view Model

Former Member
0 Kudos

<List id="invoiceList" class="sapUiResponsiveMargin" width="auto" items="{invoice>/EmployeeInfoSet(Key1='00209489')}"> <headerToolbar> <Toolbar> <Title text="{i18n>invoiceListTitle}" /> <ToolbarSpacer /> <SearchField width="50%" search="onFilterInvoices" selectOnFocus="false"/> </Toolbar> </headerToolbar> <items> <ObjectListItem title="{invoice>EmployeeNumber} x {invoice>Name}"> </ObjectListItem> </items> </List>

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member340030
Contributor
0 Kudos

Hi ,

To get the single entity you are doing it correct /<entity Set>(<key>) .. But why are you attaching the single entity to the list items ??

Thanks

Viplove Khushalani

Sharathmg
Active Contributor
0 Kudos

Reading data from service depends on the call to service from your controller or framework.

If you want a service to accept the employee id then your oData service should be designed to accept it and return the data for the provided service.

The employee response, set the uri parameter of the oData service to JSON type.

Now, the data comes to you in JSON format. Then, use simple object methods to access its content.

Regards,

Sharath