如果内容为PAGE,则SAP UI5 Popover无法正确显示内容

时间:2017-01-06 11:37:42

标签: javascript jquery popover sapui5

我正在尝试将包含页面 XML视图作为内容,并将其置于我正在使用的 popover ,xmlviewXML视图中是这样的,

<mvc:View controllerName="controllerPath"
    xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m"
    xmlns:core="sap.ui.core" height="100%" width="100%">
    <Page height="100%"
          width="100%">
    <content>
       //some content...
    </content>
    </Page>
</mvc:View>

我正在片段中创建这样的popover,

<core:FragmentDefinition
    xmlns="sap.m"
    xmlns:core="sap.ui.core">
    <Popover
        title="{Name}"
        class="sapUiContentPadding"
        placement="Bottom">
       //placing above view here...
    </Popover>
</core:FragmentDefinition>

但是,如果我这样做,它将不会显示弹出窗口内的页面因为一些高度问题。我想根据视图高度设置弹出窗口的高度(弹出窗口内容高度).i尝试使用popover contentHeight =“auto” 但这不起作用。那么如何根据内容显示popover?

1 个答案:

答案 0 :(得分:0)

sap.m.Page控件没有height和width属性。但是,sap.ui.core.View确实具有height和width属性。因此,将宽度和高度分配给View而不是page。

代码:

<mvc:View controllerName="controllerPath"
    xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m"
    xmlns:core="sap.ui.core" height="50rem"
          width="50rem">
    <Page >
    <content>
       //some content...
    </content>
    </Page>
</mvc:View>

另外,让Popover的默认宽度和高度。如果这符合您的要求,请告诉我。

更新:我给嵌入的视图提供了100%的高度和100%的宽度,同时为popover的contentHeight和contentWidth设置了100%。我得到了整个页面。屏幕截图已附上。

enter image description here