title: Bootstrap dialog confirmation onclick confirmation event
body: <p>I am trying to write my own method that calls the BootstrapDialog and creates a confirmation popup. If the user selects "confirm" then the method will return true and continue to call the jsf action. The code I have so far:</p>
  
  <pre><code> /**
   * Confirm window
   *
   * @param {type} message
   * @param {type} callback
   * @returns {undefined}
   */
  BootstrapDialog.confirmation = function(title, message) {
  
      var callback = function(result) {
          console.log(result);
          return result;
      };
  
      var b = new BootstrapDialog({
          title: title,
          message: message,
          closable: false,
          data: {
              'callback': callback
          },
          buttons: [{
                  label: 'Cancel',
                  action: function(dialog) {
                      typeof dialog.getData('callback') === 'function' &amp;&amp; dialog.getData('callback')(false);
                      dialog.close();
                  }
              }, {
                  label: 'Continue',
                  cssClass: 'btn-primary',
                  action: function(dialog) {
                      typeof dialog.getData('callback') === 'function' &amp;&amp; dialog.getData('callback')(true);
                      dialog.close();
                  }
              }]
      }).open();
  
  
      return callback;
  
  
  };
  </code></pre>
  
  <p>I am calling the js like so:</p>
  
  <pre><code>&lt;h:commandButton type="button" value="Exit" action="myaction" styleClass="btn btn-default" onclick="return BootstrapDialog.confirmation('Data unsaved', 'Are you sure you want to continue');"/&gt;
  </code></pre>
  
  <p>The dialog pops up just fine, the issue is that it is not returning true / false. I have modeled my js after this example: <a href="http://nakupanda.github.io/bootstrap3-dialog/" rel="nofollow">http://nakupanda.github.io/bootstrap3-dialog/</a></p>