Adapting Router Configuration for a List-Detail Application
Objective
After completing this lesson, you will be able to adapt router configuration for a list-detail application
Adapting Router Configuration
When designing routing for a List-Detail application, one important change is the content of the Config section of the routing.
Here are the three important properties that you must change:
The controlId must contain the id of the control that is used as a root control for displaying the UI-aspects. In an implementation using the FlexibleColumnLayout control, the controlId property contains the id of the sap.f.FlexibleColumnLayout controls, which is embedded in the sap.m.App control.
The controlAggregation attribute must contain the name of the default aggregation of the control defined by the controlId property. The specified aggregation will be filled when a new UI aspect is displayed.
The clearControlAggregation attribute has to be set to true, to allow each selection to replace (and not append) the previous one in the mid pane.
Another configuration that might slightly change when using the List-Detail pattern is the targets section.
The controlAggregation at the target level will overwrite the controlAggregation property at the routing config object for this specific target. As you can see in the figure, the value midColumnPages is assigned to the controlAggregation of the NotFound and Carrier target configuration. This means that the views of the targets will be displayed in the midColumnPages aggregation of the sap.f.FlexibleColumnLayout at runtime.
Adapt router configuration for a List-Detail application
Business Example
In this exercise, you learn how to adapt the router configuration for a List-detail Application with SAPUI5.
Note
SAP Business Technology Platform and its tools are cloud services. Due to the nature of cloud software, step procedures and naming of fields and buttons may differ from the exercise solution.
Prerequisites
You need to have completed the previous exercise to implement the root view of the application.
Steps
Check the routing configuration and modify it so that the following routing configuration parameters are configured correctly.
Routing Configuration
Configuration Parameter
Values
controlAggregation
beginColumnPages
controlId
layout
clearControlAggregation
true
bypassed target
["overview","notFound"]
Open the manifest.json file.
Locate the routing configuration config.
Make sure that the listed configuration parameters are included.
Your implementation should look like the following:
The List should still display when you preview the application but you cannot navigate to the details anymore for the moment.
Be aware that since we are not testing the application in a real SAP Fiori environment you will get errors in the console if you use Dev Tools to debug your application. Please, dismiss any message about resource preload.