title: How do I get a richfaces modal window to display without an onclick event?
body: <p>I'm trying to implement a modal window <a href="http://livedemo.exadel.com/richfaces-demo/richfaces/modalPanel.jsf" rel="nofollow">like this</a> to display an error message to the user. I have a page with a form for users to enter their information, then click Submit to add it to a database. If the database returns an error, I want the modal window to pop up with the error message.</p>
  
  <p>The only problem is I can't get the modal window to pop up unless there's some kind of onclick event. I tried using the following code:</p>
  
  <pre><code>&lt;rich:componentControl for="popup" attachTo="submitButton"
                         rendered="#{backingBean.isError}" operation="show"
                         event="onclick"/&gt;
  </code></pre>
  
  <p>The idea is that the backing bean would render it if there is an error, and it does, but only <em>after</em> you click submit and hit the database and get returned to the form to click Submit again.</p>
  
  <p>Ideally, I want the modal window to pop up when the <em>page</em> loads if <code>backingBean.isError</code> returns true, but I feel like I'm missing something to make that happen. Any ideas?</p>