title: close richfaces popupPanel if method call has certain outcome
body: <p>I'm trying to get build a simple Login Panel. The Panel is a rich:popupPanel. When the "Login" link/button is clicked I want the Panel to stay open if the login was unsuccessfull (due to wrong username/password, Database errors ... what ever). But the Panel should close if the login was successfull.</p>
  
  <p>My best attempt looks like this, but the "oncomplete" value can not be parsed</p>
  
  <pre><code>&lt;a4j:commandButton value="login" oncomplete="if (#{userController.login()}) #{rich:component('loginPanel')}.hide()"/&gt;
  </code></pre>
  
  <p>How do I get that behavior from the popupPanel?</p>