乐趣区

关于ui:如何修复-SAP-UI5-aggregation-with-cardinality-01-相关的错误消息

谬误音讯:

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

引起该谬误的 aggregation 名称:flexContent:

查看 xml 视图里该 aggregation,发现其下定义了两个控件:

删除任意一个即可:

如上图所示,我将 Popover 和 VizFrame 从新搁置,别离位于不同的 aggregation 里,之后问题隐没。

残缺的 xml 视图代码:

<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"
    xmlns:viz.data="sap.viz.ui5.data" height="100%">
    <layout:FixFlex id='chartFixFlex' minFlexSize="250">
    <layout:fixContent>
        <viz:Popover id="idPopOver"></viz:Popover>
    </layout:fixContent>
        <layout:flexContent>
            <viz:VizFrame id="jerryFrame" uiConfig="{applicationSet:'fiori'}"
                height='100%' width="100%" vizType='line'>
                <viz:dataset>
                    <viz.data:FlattenedDataset data="{/milk}">
                        <viz.data:dimensions>
                            <viz.data:DimensionDefinition name="Week" value="{Week}" />
                        </viz.data:dimensions>
                        <viz.data:measures>
                            <viz.data:MeasureDefinition name="Revenue" value="{Revenue}" />
                            <viz.data:MeasureDefinition name="Cost" value="{Cost}" />
                        </viz.data:measures>
                    </viz.data:FlattenedDataset>
                </viz:dataset>

                <viz:feeds>
                    <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" />
                </viz:feeds>
            </viz:VizFrame>
        </layout:flexContent>
    </layout:FixFlex>
</mvc:View>

更多 Jerry 的原创文章,尽在:” 汪子熙 ”:

退出移动版