title: How open modal window on page load in wicket 1.5
body: <p>I was using wicket 1.4.x for some time and solution found here worked pretty well:
  <a href="https://stackoverflow.com/questions/4765790/how-to-open-modaldialog-on-pageload">How to open ModalDialog on PageLoad</a>
  But when I moved to wicket 1.5 I simply don't know how make a modalwindow popup on page load.</p>
  
  <p>A piece of code looks like this:</p>
  
  <pre><code>private PlainModalWindow tmpPassChange = new PlainModalWindow( "tmp_pass_change" );
  tmpPassChange.add( new OpenWindowOnLoadBehavior() );
  tmpPassChange.setInitialHeight( 418 );
  tmpPassChange.setResizable( false );
  tmpPassChange.setMaskType( ModalWindow.MaskType.SEMI_TRANSPARENT );
  tmpPassChange.setPageCreator( new ModalWindow.PageCreator()
  {
    private static final long serialVersionUID = 1L;
  
    public Page createPage()
    {
      return new TmpPassChange( u, tmpPassChange );
    }
  } );
  add( tmpPassChange );
  </code></pre>
  
  <p>To explain, I'm checking if page has a certain parameter. When there is one I search user with that parameter in datebase. When I have one I'd like to open PlainModalWindow, this window is class extending normal ModalWindow with a css removing style and that's it. The load behavior looks like this:</p>
  
  <pre><code>public class OpenWindowOnLoadBehavior extends AbstractDefaultAjaxBehavior
  {
  
  private static final long serialVersionUID = 1L;
  
  @Override
  protected void respond( AjaxRequestTarget target )
  {
      ModalWindow window = (ModalWindow) getComponent();
      window.show( target );
  }
  
  public void renderHead( IHeaderResponse response )
  {
      response.renderOnLoadJavaScript( getCallbackScript().toString() );
  }
  }
  </code></pre>
  
  <p>As I meanioned above, it worked in wicket 1.4 :(</p>