miroana
miroana

Reputation: 552

Wicket 9 and a pop up window (not modal)

I have a link which opens a pop up (not a modal window, but a small browser window)

protected void onInitialize() {
    super.onInitialize();
    Link<Void> myLink = new Link<>("myLink") {
        @Override
        public void onClick() {
            setResponsePage(new MyPage((IModel<MyDto>) getDefaultModel()));
        }
    };
    myLink.setPopupSettings(new PopupSettings());
    myLink.getPopupSettings().setHeight(100).setHeight(100);
    Button button = new Button("button");
    myLink.add(button);
    add(myLink);
}

When I click on it everything works fine (as expected). But after closing the pop up window the rest of the page becomes unusable, i.e

If after closing pop up window I click a button or if I type something in ajaxTextField

I get all kinds of errors such as NoSuchMethod (on my model class I use constructor initiation, so no setters). NullPointerExeption... Etc.

However, if after closing a modal window, I refresh the page then everything works as expected again.

What I'm doing wrong? How to make so that after closing a modal window all buttons, text fields, links, etc. would work as expected without manually refreshing the page from which the pop up window was showed?

Upvotes: 0

Views: 233

Answers (1)

miroana
miroana

Reputation: 552

Finally found it. These errors where happening, because some of my models where made transient, i.e.

private transient final LoadableDetachableModel<Long> myModel;

removing transient fixed an issue

Upvotes: 1

Related Questions