Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModalX autoSize doesn't work the first time. Only the second time. #422

Open
ghost opened this issue Oct 4, 2015 · 3 comments
Open

ModalX autoSize doesn't work the first time. Only the second time. #422

ghost opened this issue Oct 4, 2015 · 3 comments

Comments

@ghost
Copy link

ghost commented Oct 4, 2015

I want to display a picture using a ModalX ModalContentPanel class. I added the setting "setAutoSize(true)" and "setUseInitialHeight(false)" to the ModalContentWindow class.
When I click on the thumb of the photo it always shows up in a 200x200 window with scrollbars. When I close it and click on it again it appears in full size.

@martin-g
Copy link
Member

martin-g commented Oct 4, 2015

@chrisco484 Ping!

@chrisco484
Copy link
Contributor

What version of Wicket are you using it with?


From: tpijl [mailto:[email protected]]
Sent: Sunday, 4 October 2015 9:10 PM
To: wicketstuff/core
Subject: [core] ModalX autoSize doesn't work the first time. Only the
second time. (#422)

I want to display a picture using a ModalX ModalContentPanel class. I
added the setting "setAutoSize(true)" and "setUseInitialHeight(false)"
to the ModalContentWindow class.
When I click on the thumb of the photo it always shows up in a 200x200
window with scrollbars. When I close it and click on it again it appears

in full size.

Reply to this email directly or view it on GitHub
#422 .
<https://github.com/notifications/beacon/AA6iP_2h4-rkN42ysvwJ0wO1nNAOH17
Oks5o4PJ0gaJpZM4GIkP3.gif>

@ghost
Copy link
Author

ghost commented Oct 10, 2015

I am using Wicket 7.1.0-SNAPSHOT with ModalX version 7.0.0, but it also act the same in 7.0.0.
Here is the fragment where I activate the modal:

        AjaxLink thumbLink = new AjaxLink("thumblink") {
            /** The serialVersionUID. */
            private static final long serialVersionUID = 3196029341454979704L;

            @Override
            public void onClick(final AjaxRequestTarget target) {
                // popup content
                ModalContentWindow mcw = ((HomePage) getPage()).allocateContentWindow();
                PhotoPopupPanel popup = new PhotoPopupPanel(mcw, path + "_web.jpg");
                popup.setTitle(photoTitle);
                popup.show(target);
            }
        };

And here I create the ModalContentWindow:

    public ModalContentWindow allocateContentWindow() {
        ModalContentWindow mcw = this.allocateModalWindow();
        mcw.setUseInitialHeight(false);
        mcw.setAutoSize(true);
        mcw.setResizable(false);
        return mcw;
    }

The PhotoPopupPanel:

public class PhotoPopupPanel extends ModalContentPanel {

    /** The serialVersionUID. */
    private static final long serialVersionUID = -3900566859100449028L;

    public PhotoPopupPanel(final ModalContentWindow mcw, final String path) {
        super(mcw, null);
        this.setOutputMarkupId(true);
        Photo photo = new Photo("photo", path);
        add(photo);
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants