on 08-26-2016 8:15 AM
Hey,
Is there any (clean) way to avoid the auto closing behaviour of sap.m.Popover or sap.m.ResponsivePopover? I know that there is a property for setting the modality, but that is not what I need because interaction with the background is not possible. In the source code I saw that they make use of sap.ui.core.Popup and that this control supports an auto closing property, which is set to true for the popover classes (except sap.m.MessagePopover).
I am very grateful for any suggestions!
Best regards,
Matthias
In case anyone has a similar problem:
I managed to solve my issue by creating a custom control that extends from Popover. This way I can also easily use it with an XML fragment. See the code below:
sap.ui.define([ "sap/m/Popover" ], function(Control) {
"use strict";
return Control.extend("<namespace>.CustomPopover", {
init : function() {
Control.prototype.init.apply(this, arguments);
this.oPopup.setAutoClose(false);
},
renderer : "sap.m.PopoverRenderer"
});
});
And the XML fragment:
<!DOCTYPE xml>
<core:FragmentDefinition xmlns="sap.m"
xmlns:core="sap.ui.core" xmlns:util="<namespace>">
<util:CustomPopover title="{i18n>popoverCustomTitle}"
afterClose="handlePopoverAfterClose" class="sapUiPopupWithPadding"
placement="Auto" id="_customPopover">
<util:content>
<HBox alignItems="Center">
<items>
<Input width="100%" id="_customPopoverInput" textAlign="Begin"
class="numberInput" type="sap.ui.model.type.Float" editable="true"
maxLength="12" />
<Label text="{i18n>labelCustomPopover}" width="100%" design="Bold"
class="sapUiTinyMarginBegin" />
</items>
</HBox>
</util:content>
</util:CustomPopover>
</core:FragmentDefinition>
Best regards,
Matthias
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please explain more on this correct answer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
the popover doesnt do auto close
the closing event is because you probably clicked outside of it and it loses focus...
would a dialog control satisfy your requirement ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.