Demo Application: Data Reuse and Synchronisation
DESCRIPTION
This demo application demonstrates how to synchronize data between a list report
(first column) and an object page (second column) by using the
V4 ODataModel#getKeepAliveContext API. It also demonstrates how to replace an active
version with a draft and vice versa.
Note: The application uses the responsive Flexible Column Layout control, which
might hide columns if there is not enough space within the browser window. So use the
app in fullscreen mode to prevent automatically hiding of columns which would result in
a different behavior than described here.
Scenario: Start with list report, navigate to object page, edit
Start Up
- Start the Draft application with URL:
/test-resources/sap/ui/core/demokit/sample/common/index.html?component=odata.v4.Draft
- Select the first product in the list report.
- Note: An object page for the product appears, no input field is editable,
only the
Edit
button is enabled.
Edit & Cancel
- Press the
Edit
button.
- Note: Some input fields are now editable, all buttons but
Edit
are enabled, and the list report shows that the first product is not an active
entity.
- Enter 'Test' into the input field
Name
of the object page.
- Note: The list report shows the new name of the first product.
- Press the
Cancel
button.
- Note: No input field is editable, only the
Edit
button is
enabled, and the list report shows that the first product is an active entity with
its original name.
Edit & Activate
- Press the
Edit
button.
- Note: Some input fields are now editable, all buttons but
Edit
are enabled, and the list report shows that the first product is not an active
entity.
- Enter 'Test' into the input field
Name
of the object page.
- Note: The list report shows the new name of the first product.
- Enter a new quantity like '123' into the
Quantity
input field of the
first part in the Parts table of the object page.
- Press the
Save
button.
- Note: No input field is editable, only the
Edit
button is
enabled, the list report shows that the first product is an active entity with a new
name, and the Parts table of the object page shows the new quantity of the first
part.
Cancel Without Edit
- Select the second product in the list report.
- Note: An object page for the product appears, some input fields are
editable, all buttons but
Edit
are enabled, and the list report shows
that the second product is not an active entity.
- Enter 'Test' into the input field
Name
of the object page.
- Note: The list report shows the new name of the second product.
- Press the
Cancel
button.
- Note: No input field is editable, only the
Edit
button is
enabled, and the list report shows that the second product is an active entity with
its original name.
Scenario: Start with list report and object page, edit
- Start with URL:
/test-resources/sap/ui/core/demokit/sample/common/index.html?component=odata.v4.Draft#/Products(ID=10,IsActiveEntity=true)
- Note: The list report and an object page for the product with ID 10 appears,
no input field is editable, only the
Edit
button is enabled in the
object page.
- Repeat the tests "Edit & Cancel" and "Edit & Activate" from above.
Scenario: Start with object page without list report, first show list then edit
- Start with URL:
/test-resources/sap/ui/core/demokit/sample/common/index.html?component=odata.v4.Draft#/Products(ID=10,IsActiveEntity=true)?noList
- Note: An object page for the product with ID 10 appears, no input field is
editable, only the
Edit
button is enabled.
- Press the "Show List" button.
- Note: The list report appears.
- Repeat the tests "Edit & Cancel" and "Edit & Activate" from above.
Scenario: Start with object page without list report, first edit then show list
- Start with URL:
/test-resources/sap/ui/core/demokit/sample/common/index.html?component=odata.v4.Draft#/Products(ID=10,IsActiveEntity=true)?noList
- Note: An object page for the product with ID 10 appears, no input field is
editable, only the
Edit
button is enabled.
- Repeat the tests "Edit & Cancel" and "Edit & Activate" from above.
- Press the "Show List" button.
- Note: The list report appears.
Scenario: Start with list report, navigate to defective product
Start Up
- Start the Draft application with URL:
/test-resources/sap/ui/core/demokit/sample/common/index.html?component=odata.v4.Draft
- Select the last product in the list report.
- Note: An error page is shown telling that there was a "Communication error"
with status code 500.
Scenario: Start with defective product in object page
Start Up
- Start the Draft application with URL:
/test-resources/sap/ui/core/demokit/sample/common/index.html?component=odata.v4.Draft#/Products(ID=40,IsActiveEntity=true)
- Note: An error page is shown telling that there was a "Communication error"
with status code 500.