Show TOC

View ReplacementLocate this document in the navigation structure

Views of a delivered standard application can be replaced to adapt the application to the customer needs.

If the extension points provided for view extension are not sufficient to meet the requirements of the custom application, you can replace the standard view with a custom view.

The following view is delivered in the standard application:

<mvc:View xmlns="sap.ui.commons" xmlns:mvc="sap.ui.core.mvc">
    <TextView text="SAP View 'Sub1' - this one should have been replaced by the customer View"></TextView>  
</mvc:View>

This is the custom view to replace the standard view:

<mvc:View xmlns="sap.ui.commons" xmlns:mvc="sap.ui.core.mvc">
    <TextView text="Custom View 'Sub1' - this one replaces the original SAP View 'Sub1'"></TextView>    
</mvc:View>

The following customizing replaces the custom view with the view in the standard application

customizing: {
    .....some more content
    "sap.ui.viewReplacements": {
        "samples.components.ext.sap.Sub1": {
            viewName: "samples.components.ext.customer.CustomSub1",
            type: "XML"
        }
    },
    .....some more content