title: window.close() from backing bean
body: <p>I am trying to close the main window if a certain condition satisfies. If it does not satisfy, then it should show a dialog box. I am able to show the dialog box when the condition does not satisfy, but i am not able to close the window when it does. What function can I call to close the window? is the approach used for closing the window correct?</p>
  
  <pre><code>if(condition() == false){
  
     context.execute("PF('dialogbox').show();");
  }else{
  
     context.execute("PF(window.close());"); //
  
  }
  </code></pre>
  
  <p>Any help would be appreciated.</p>