Skip to Content

How to extend the NavigationListItem control in SAPUI5?

I want to extend the NavigationListItem control to accept sap.ui.core.Control objects in it's aggregation. I have created a separate file to extend the control and added a new aggregation called 'rows' with type sap.ui.core.Control in the metadata section. The extended control is getting called in the view, but it is not displaying any child controls which were added to the new aggregation 'rows'. Please advise, if I need to add anything more to the extension file.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Aug 23, 2017 at 07:21 AM

    Please share your code.

    Add comment
    10|10000 characters needed characters exceeded

    • sap.ui.define(["sap/ui/core/Control",
      "sap/tnt/NavigationListItem",
      ], function(Control, NavigationListItem) {
      "use strict";
      return NavigationListItem.extend("ajacontrolExt.control.NavigationCustomListItem", {
      metadata: {
      properties: {
      },
      defaultAggregation: "rows",
      aggregations: {
      rows: {
      type: "sap.ui.core.Control",
      multiple: true,
      singularName: "row"
      }
      },
      events: {},
      },
      });
      });