Show TOC

Extension Points for FacetsLocate this document in the navigation structure

You usually define application-specific facets in the form of annotations, but in some cases it might be necessary to integrate components at the frontend, for example, charts or attachments.

Applications are enabled to embed external components by using the extension-point concept of SAPUI5.

For more information, see View Extension.

Extension points are available on the object page to add additional facets. Additional facets can be added in the following places:
  • BeforeFacet: The extension will be inserted before a given facet.

  • ReplaceFacet: The extension will be rendered instead of an existing facet.

  • AfterFacet: The extension will be inserted after a given facet.

You must specify the facet in the form of its annotation path. In addition, you must specify the entitySet name, as the same annotation path may exist for various entity sets. You add this information in the manifest.json file, as in the following examples:
"extends": {
   "component": "sap.ui.generic.app.AppComponent",
   "minVersion": "1.1.0",
   "extensions": {
    "sap.ui.viewExtensions": {
    "sap.suite.ui.generic.template.ObjectPage.view.Details": {
     "AfterFacet|SEPMRA_C_PD_Product|ProductCollectionFacetID": {
      "className": "sap.ui.core.mvc.View",
      "viewName": "nw.epm.refapps.st.prod.manage.ext.ProductDetailReview",
      "type": "XML",
      "sap.ui.generic.app": {
         "title": "Reviews"
      }
     },
     "BeforeFacet|SEPMRA_C_PD_Product|to_ProductText::com.sap.vocabularies.UI.v1.LineItem": {
      "className": "sap.ui.core.Fragment",
      "fragmentName": "nw.epm.refapps.st.prod.manage.ext.BeforeFacetTest",
      "type": "XML",
      "sap.ui.generic.app": {
         "title": "Facet Breakout before Product Text LineItem"
      }
     },
     "ReplaceFacet|SEPMRA_C_PD_Product|MyFacet": {
      "className": "sap.ui.core.mvc.View",
      "viewName": "nw.epm.refapps.st.prod.manage.ext.view.FacetContentTest",
      "type": "XML"
     }
Note

You can specify either a view or a fragment contained in the additional facet. In both cases, you do not need to use the object page (uxap) tags ObjectPageSection, subSections, or ObjectPageSubSection. These definitions are already part of the smart template's object page view. Additional sections are rendered if an extension exists.

For an example with step-by-step instructions, see Adding A Section To An Object Page.