docs

View Modification

View modification lets you change specific properties of controls in standard views without altering the structure of the view itself.

Currently, view modification is restricted to the visible property of controls, meaning that you can hide controls in your custom application.

To modify a control, it must meet the following requirements:

View modification works across different view types, including XML views and typed views.


Example

Here’s an example for a view named SampleView.view.xml in the standard application:

<mvc:View xmlns="sap.m" xmlns:mvc="sap.ui.core.mvc">
    <Text text="SAP View 'SampleView' - the text after this one is hidden by customizing: "></Text>
    <Text id="someCustomizableTextControl" text="This text is made invisible by customization"></Text>  
</mvc:View>

To hide the second Text control with the someCustomizableTextControl ID, you would configure the view modification in your component’s manifest.json like this:

extensions: {  
    "sap.ui.viewModifications": {
        "samples.components.ext.sap.SampleView": {
            "someCustomizableTextControl": {
                "visible": false
            }
        }
    }
}

The view modification configuration follows this structure:

When the application loads, OpenUI5 automatically applies these modifications, making the specified control invisible without requiring any changes to the original view definition.