Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6802589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:14:30+00:00 2026-05-26T19:14:30+00:00

I was using wicket 1.4.x for some time and solution found here worked pretty

  • 0

I was using wicket 1.4.x for some time and solution found here worked pretty well:
How to open ModalDialog on PageLoad
But when I moved to wicket 1.5 I simply don’t know how make a modalwindow popup on page load.

A piece of code looks like this:

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 );

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:

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() );
}
}

As I meanioned above, it worked in wicket 1.4 🙁

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T19:14:31+00:00Added an answer on May 26, 2026 at 7:14 pm

    As I couldn’t find answer for this thing I made a workaround. Maybe it helps somebody. First add to HTML file link (display: none so no one will see it) :

    <a style="display: none;" wicket:id="openPopup" id="openPopup"/>
    

    Create an AjaxLink:

    AjaxLink openPopup = new AjaxLink("openPopup") 
    {
        @Override
        public void onClick(AjaxRequestTarget target) 
        {
            tmpPassChange.show( target );
        }
    };
    add (openPopup);
    

    And In renderHead method check your conditions for opening popup :

    public void renderHead( IHeaderResponse response )
    {
        String jQueryString = "";
        if ( u != null )
        {
            jQueryString += "jQuery('#openPopup').trigger('click');";
        }
        response.renderOnLoadJavaScript( jQueryString );
    }
    

    Hopefully it will help somebody, works for me 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am pretty new to Wicket and i have some difficulties with using resource
I'm new to website development using Java but I've got started with Wicket and
How do I redirect to another page using Wicket? IIRC, some exception has to
I'm using Wicket + EJB3 in an application and I face a problem but
I am currently working on a web app using Wicket and started using jQuery
I'm trying to start a Wicket Application using Felix implementation of OSGi HTTP service,
We're creating a web system using Java and Servlet technology (actually Wicket for the
Using C# .NET 3.5 and WCF, I'm trying to write out some of the
Can you recommend a simple/best tool for an web application developed using Wicket framework?
We are using Wicket with Hibernate in the background. As part of out UI

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.