Skip to Content
avatar image
Former Member

Create new control issue

Hi All,

I try to create new UI5 control which is composite control and I need to use the DropdownBox as aggregation

This is my code.

sap.ui.define([
"sap/ui/core/Control",

"sap/ui/core/DropdownBox",


], function (Control, DropdownBox) {

Control.extend("newControl", {

  metadata: {

  aggregations: {

  dropdownBox: {

  type: "sap.ui.commons.DropdownBox",

  mutiple: true,

  visibility: "hidden"

  },

....

Now I want to use the following

this.setAggregation("dropdownBox", new DropdownBox({

  enabled: false,

  busy: true,

  layoutData: new sap.ui.layout.GridData({

  span: "L7 M8 S12"

  })

  }));

In this line of the setAggregation I got error when I run my app

Uncaught Error: Aggregation '_dropdownBox' of Element newControl#__section2 used with wrong cardinality (declared as 0..n)

What am I missing here ?

I've tried also with multiple false and I got the same error 😔  please assist .

Miley

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Nov 03, 2015 at 02:50 PM

    not setAggregation but addAggregation it is mutiple: true

    Add comment
    10|10000 characters needed characters exceeded