title: SAPUI5/OPENUI5 - Routing with Dialogs
body: <p>I´m currently stuck with the combination of routing and dialogs.
  I have a view with list elements and when I click on an element in the list I want the Detail view to be shown in a Dialog (Popup).
  The thing is, I also want the ID of the list element in my url and when I reload the page while the dialog is still open, I want to jump to this exact position again (the dialog is in fullscreen, it looks like a own view).</p>
  
  <p>So, what I got so far:</p>
  
  <p>When I click on an element in the list I call this function</p>
  
  <pre><code>campaignSelectHandler : function () {
      if(!this.fragment) {
          var controller = new sap.ui.controller("ui.controls.fragments.EventDetail");
          this.fragment = sap.ui.xmlfragment("ui.controls.fragments.EventDetail", controller);
      }
      //this.router.navTo(navigation.Constants.EventDetailFragment, {id : 12345});
      this.router.navTo(navigation.Constants.EventDetailFragment, {id: 1337});
      this.fragment.open();
  },
  </code></pre>
  
  <p>Next thing is I jump to my fragment</p>
  
  <pre><code>&lt;Dialog     id="dialogEventDetail"
          xmlns:view="ui.views.pages"
          xmlns="sap.m"
          xmlns:controls="ui.controls"
          xmlns:core="sap.ui.core"
          xmlns:mvc="sap.ui.core.mvc"
          contentWidth="100%" contentHeight="100%"
          showHeader="false"
          class="eventDetail"
          horizontalScrolling="false"
          verticalScrolling="false"&gt;
  
  &lt;mvc:XMLView viewName="ui.views.pages.EventDetail"&gt;
  
  &lt;/mvc:XMLView&gt;
  
  &lt;/Dialog&gt;
  </code></pre>
  
  <p>In this Dialog fragment I load my view including my controller etc.
  This works for opening a Dialog and display the url path but obviously as soon as I reload the page everything is gone.</p>
  
  <p>In addition to that, I extend the "ui.views.pages.EventDetail" view from a AbstractController where I initiate the router. It works fine for my normal view but when I open the dialog I loose the reference to it and cannot route back to my initial view.</p>
  
  <p>I know this solution cannot work so I hope you have some advices on how to get it to work!</p>
  
  <p>Thanks in advance!</p>
  
  <p>BTW: This is the Component.js</p>
  
  <pre><code>routes : [
              {
                  pattern : "",
                  name : navigation.Constants.MyEvents,
                  view : navigation.Constants.MyEvents,
                  viewId : navigation.Constants.MyEvents,
                  targetAggregation : "pages",
                  targetControl : "idAppControl",
                  subroutes : [
                      {
                          pattern : "{id}",
                          name : navigation.Constants.EventDetailFragment,
                          view : navigation.Constants.EventDetailFragment
                      }
                  ]
              }
  </code></pre>