# Manual Integration Test: Flexible Column Layout - Keep-alive Scenario

## DESCRIPTION

This demo application is used to demonstrate how to synchronize data between a list report (left column), an object page (middle column) and a sub-object page (right column) by using the `Context#setKeepAlive` API method.

## PREPARATION

To check console errors open the developer tools before starting the application and check with each step, that there are no errors and warnings.

### Testing with mock data

Start the FlexibleColumnLayout application URL (adjust host and port if necessary):

- local: http://<host>:<port>/test-resources/sap/ui/core/demokit/sample/common/index.html?component=odata.v4.FlexibleColumnLayout

## REALIZE and CHECK

### List report and object page are in sync

1. Select the first sales order in the sales order list report.
2. Check: An object page for the sales order appears.
3. Enter 'Test' into the input field `Note` of the object page.
4. Press the `Sales Order ID` button in the header of the respective column of the sales orders table of the list report.
5. Check: The sales order list is sorted by the `SalesOrderID` and the selected sales order does no longer appear in the list report. It is still present in the object page.
6. Press the `Sales Order ID` button in the header of the respective column of the sales orders table of the list report.
7. Check: The sales order appears again in the list report and and its property `Note` has the value 'Test'.
8. Enter 'Test (changed)' into the input field `Note` (of the object page) and leave the field.
9. Check: Both the list report and the object page are in sync.
10. Press the `Cancel` button.
11. Check: Both the list report and the object page are in sync.

### Object page and sub-object page are in sync

1. Select the first sales order line item on the object page.
2. Check: A sub-object page with item details appears.
3. Enter '2' into the input field `Quantity` of the sub-object page.
4. Press the `Gross Amount` button.
5. Check: The sales order item list is sorted by the `GrossAmount` and the selected sales order item is no longer part of the items list. In the sub-object page it is still present.
6. Press 'More' on the item table of the object page.
7. Check: Both the object page and the sub-object page are in sync.
8. Press the `Cancel` button.
9. Check: Both the object page and the sub-object page are in sync.

### Delete a kept-alive context that is not visible in the sales orders table; after deletion the count does not change

1. Select the fifth sales order on the list report that is currently sorted ascending by the `Sales Order ID`.
2. Check: The object page is updated.
3. Check: The count for the sales order table in both, the title and below the `More` button is 10.
4. Enter 'Test' into the input field `Note` of the object page.
5. Enter '1000' in the search field of the sales order table.
6. Check: The count for the sales order table in both, the title and below the `More` button is 7.
7. Check: The table is filtered and the selected sales order is not visible on the sales order table.
8. Press the `Cancel` button.
9. Press the `Delete` button on the sales order object page.
10. Check: The object page vanishes and there is no error message.
11. Press the `Sales Order ID` button in the header of the respective column of the sales orders table of the list report.
12. Check: The deleted sales order is not visible in the list report.
13. Check: The count for the sales order table in both, the title and below the `More` button is still 7.
14. Check: The corresponding sales order is no longer existing and the object page vanishes.

### Delete a kept-alive context in a table with transient contexts; after deletion the count changes

1. Select the first sales order on the list report that is currently sorted ascending by the `Sales Order ID`.
2. Check: An object page for the first sales order occurs.
3. Check: The count for the sales order line item table in both, the title and below the `More` button is 27.
4. Select the first sales order line item on the object page.
5. Check: A sub-object page with the item details appears.
6. Press the `Gross Amount` button.
7. Check: The sales order item list is sorted by `GrossAmount` and the selected sales order item is no longer part of the items list. In the sub-object page it is still present.
8. Check: The count of sales order line items table is still 27.
9. Press the `Create Line Item` button in the toolbar of the sales order line items table.
10. Check: A new line item occurs and the count for the sales order line item table in both, the title and below the `More` button is 28.
11. Press the `Delete` button of the sub-object page.
12. Check: The sub object page vanishes.
13. Check: The newly created sales order item is still there and the count for the sales order line item table in both, the title and below the `More` button is 27.
14. Press the `Cancel` button.
15. Check: The newly created sales order item vanishes and the count for the sales order line item table in both, the title and below the `More` button is 26.

### Refresh the object page of a kept-alive context that is not visible in the sales orders table; after refreshing the sales order is no longer available

1. Press the `Sales Order ID` button in the header of the respective column of the sales orders table of the list report.
2. Select the second sales order in the sales order list report.
3. Check: An object page with the sales order appears.
4. Press the `Sales Order ID` button in the header of the respective column of the sales orders table of the list report.
5. Check: The sales order list is sorted by the `SalesOrderID` and the selected sales order does no longer appear in the list report. It is still present in the object page.
6. Check: The value of the `Sales Order ID` input field is '0500000009'
7. Press the `Refresh` button on the sales order object page.
8. Check: The corresponding sales order is no longer existing and the object page vanishes.

### Refresh the object page of a kept-alive context that is visible in the sales orders table; after refreshing the object page, the sales order does no longer appear in the list

1. Select the first sales order in the sales order list report.
2. Check: An object page for the sales order appears.
3. Enter '1000' in the search field of the sales order table.
4. Check: The table is filtered but the selected sales order is still visible on the sales order table.
5. Press the `Refresh` button on the sales order object page.
6. Check The object page is updated and shows new data but the sales order does no longer appear in the sales order table.

### Refresh the `New Sales Orders` list with a kept-alive context that is not visible in the list; after refreshing the `New Sales Orders` list, the sales order appears again in the list

1. Select the fifth sales order in the `New Sales Orders` list.
2. Check: An object page `Sales Order Details` for the selected sales order appears.
3. Enter '1000' in the search field of the `New Sales Orders` list and press enter.
4. Check: That the sales order '0500000004' is filtered out from the `New Sales Orders` list, but still exists on the `Sales Order Details` object page.
5. Press the `Refresh` button on the `New Sales Orders` list.
6. Check The object page `Sales Order Details` is updated and shows new data and the sales order '0500000004' appears again in the `New Sales Orders` list.

### Increase sales order line items' quantities

1. Select the first sales order in the list report.
2. Check: An object page `Sales Order Details` for the selected sales order appears.
3. Select the first sales order line item on the object page.
4. Check: A sub-object page with item details appears.
5. Press the `Gross Amount` button.
6. Check: The sales order item list is sorted by the `GrossAmount` and the selected sales order item is no longer part of the items list. In the sub-object page it is still present.
7. Press the `Increase all Sales Order Items' Quantities by 1` button.
8. Check: The quantity on the sub-object page and all quantities for line items in the object page are increased by one.
9. Check: The gross amount and the note for the selected sales order in the list report and object page changed too.

Technical background: requestSideEffects must also update the item in the sub-object page even if it is not in the list currently.