loio |
---|
bcdbde6911bd4fc68fd435cf8e306ed0 |
view on: demo kit nightly build | demo kit latest release
In this tutorial, we explore how features of OData V4 can be used in OpenUI5. We write a small app that consumes data from an OData V4 service to understand how to access, modify, aggregate, and filter data in an OData V4 model.
OData is a standard protocol for creating and consuming data by using simple HTTP and REST APIs for create, read, update, delete (CRUD) operations.
We start with an initial app that simply retrieves data from an OData V4 service and displays it as a plain list.
You don't have to do all tutorial steps sequentially, you can jump directly to any step you want. In each step, download the code from the previous step, copy it to your workspace, and make sure that the application runs by calling the
webapp/index.html
file.You can view and download the samples for all steps in the Demo Kit at OData V4. Depending on your development environment you might have to adjust resource paths and configuration entries.
For more information check the Downloading Code for a Tutorial Step section of the tutorials overview page Get Started: Setup, Tutorials, and Demo Apps.
- Step 1: The Initial App
We start by setting up a simple app that loads data from an OData service and displays it in a table. We use a mock server to simulate requests to and responses from the service. - Step 2: Data Access and Client-Server Communication
In this step, we see how theTable
that is bound to thePeople
entity set initially requests its data, and how the data can be refreshed. We use the Console tab in the browser developer tools to monitor the communication between the browser and the server. We see the initial request as well as the requests for refreshing the data. - Step 3: Automatic Data Type Detection
In this step, we use the automatic data type detection of the OData V4 model to parse, validate, and format user entries. The service metadata contains type information for the properties of each entity. - Step 4: Filtering, Sorting, and Counting
In this step, we add features to filter, sort, and count the user data by using the OData V4 model API to apply OData system query options$filter
,$orderby
, and$count
. - Step 5: Batch Groups
In this step, we have a closer look at batch groups. Batch groups are used to group multiple requests into one server request to improve the overall performance. - Step 6: Create and Edit
In this step, we will make it possible to create and edit (update) user data from the user interface and send the data to the back end. - Step 7: Delete
In this step, we make it possible to delete user data. - Step 8: OData Operations
Our OData service provides one OData operation: theResetDataSource
action. In this step, we add a button that resets all data changes we made during the tutorial to their original state using this action. - Step 9: List-Detail Scenario
In this step we add a detail area with additional information. - Step 10: Enable Data Reuse
In this step we avoid unnecessary back-end requests by preventing the destruction of data shown in the detail area when sorting or filtering the list. - Step 11: Add Table with :n Navigation to Detail Area
In this step we add a table with additional information to the detail area.
Related Information