How to fix error messages related to sap ui5 aggregation with cardinality 0.. 1

Error message:

Assertion failed: multiple aggregates defined for aggregation with cardinality 0..1

The aggregation name that caused the error: flexcontent:

Check the aggregation in the XML view and find that two controls are defined under it:

Delete any one:

As shown in the figure above, I reposition Popover and vizframe in different aggregations, and then the problem disappears.

Complete XML View Code:

<mvc:View controllerName="sap.viz.sample.Line.Line" xmlns="sap.m"
    xmlns:viz="sap.viz.ui5.controls" xmlns:layout="sap.ui.layout"
    xmlns:mvc="sap.ui.core.mvc" xmlns:viz.feeds="sap.viz.ui5.controls.common.feeds""" height="100%">
    <layout:FixFlex id='chartFixFlex' minFlexSize="250">
        <viz:Popover id="idPopOver"></viz:Popover>
            <viz:VizFrame id="jerryFrame" uiConfig="{applicationSet:'fiori'}"
                height='100%' width="100%" vizType='line'>
                    < data="{/milk}">
                            < name="Week" value="{Week}" />
                            < name="Revenue" value="{Revenue}" />
                            < name="Cost" value="{Cost}" />

                    <viz.feeds:FeedItem id='valueAxisFeed' uid="valueAxis" type="Measure"
                        values="Revenue" />
                    <viz.feeds:FeedItem id='valueAxisFeed2' uid="valueAxis" type="Measure"
                        values="Cost" />
                    <viz.feeds:FeedItem id='categoryAxisFeed' uid="categoryAxis" type="Dimension"
                        values="Week" />

More Jerry’s original articles can be found in: “Wang Zixi”:

Similar Posts: