Search code examples
sapui5

How to resize Popover window?


I have created a Popover that looks as follows:

enter image description here

How to set the Popover window smaller?


Solution

  • if you just wanna show an information to the user use an sap.m.MessageBox.

        sap.m.MessageBox.information(
                "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat"
            );
    

    enter image description here

    If you need sap.m.Popover go for sth. like this:

    contentWidth="{= ${device>/system/phone} ? '100%' : '20%'}"

    <core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core">
    <Popover title="Popover" placement="Bottom" contentWidth="{= ${device>/system/phone} ? '100%' : '20%'}" class="sapUiContentPadding">
        <Text
            text="Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet."/>
    </Popover>
    

    </core:FragmentDefinition>

    enter image description here