title: How to destroy session when escape button is clicked in dialog in UI5?
body: <p>I have created a calendar in UI5 application and on calling tapOnDate method I am calling a UI5 Dialog with custom Create and reject button.</p>
  
  <p>I have to manually destroy the dialog every time to work it next time. See below code:</p>
  
  <pre><code> oDialog1.addButton(new sap.ui.commons.Button({text: "Create", 
        style: sap.ui.commons.ButtonStyle.Accept,
         press:function()
         {
             oDialog1.destroy();
             oDialog1.close();
  
         }
  </code></pre>
  
  <p>But when I click escape/cancel button which by default comes with a dialog and  try to select a date second time, the dialog doesn't appear and I know the reason because after clicking the close(X) button I need to destroy the dialog session, but my problem is how can I write such code?  </p>