Skip to Content
0
Former Member
May 23, 2016 at 01:44 AM

sap.m.Page open dialog after routing

364 Views

Hi,

Having some trouble opening a Dialog after navigating to a page. The intention is to always open the dialog when a user lands on this page.

Simplified, I have a controller that looks like this:

onInit: function() {}

this.myRouter.getRoute("orderscreate").attachPatternMatched(this._onObjectMatched, this);

},

_onObjectMatched: function() {

this.dialog = sap.ui.xmlfragment("myDialog", this);

this.dialog.open();

},

When I put a debugger in, this works great, I can see the dialog is open.

THEN, the navigation animation kicks in, does the slide animation, and upon completion the dialog is closed again. I'm not sure why it insist on navigating after the view has rendered.

This happens when using navTo as well. Dialog opens, animation starts, dialog is closed again. sap.m.Page does not have another way of executing code after showing, as far as I'm aware.

Any advice?