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

Infinte loop in ModalCloseButton.onConfigure() #90

Closed
imtron opened this Issue Nov 27, 2012 · 3 comments

Comments

Projects
None yet
2 participants
@imtron
Copy link

imtron commented Nov 27, 2012

Hi,

when searching the Modal, the parent is always taken from the ModalCloseButton component and produces an infinite loop.

The code should be something like:

@Override
    protected void onConfigure() {
        super.onConfigure();

        if (getAnchor() == null) {
            Component parent = getParent();
            while (parent  != null) {
                if (parent instanceof Modal) {
                    setAnchor(parent);
                    break;
                } else {
                    parent = parent.getParent();
                }
            }
        }
    }

used version 0.6.7

p.s.: thumbs up, great work, simplifies a lot for me!

@ghost ghost assigned l0rdn1kk0n Nov 27, 2012

@l0rdn1kk0n

This comment has been minimized.

Copy link
Owner

l0rdn1kk0n commented Nov 27, 2012

thanks ;)

can you add your code how you use the modal dialog? i can't reproduce it. (i've added a sample to Issues page in sample module)

l0rdn1kk0n added a commit that referenced this issue Nov 27, 2012

@imtron

This comment has been minimized.

Copy link
Author

imtron commented Nov 28, 2012

i added the ModalCloseButton with addButton(), therefore the anchor isn't set ant it tries to search the Modal up the hierarchy.

private Modal newModalDialog(String markupId) {
  final Modal modal = new TextContentModal(markupId, Model.of("Issue #90"));
  modal.addButton(new ModalCloseButton());
  return modal;
}
@l0rdn1kk0n

This comment has been minimized.

Copy link
Owner

l0rdn1kk0n commented Nov 28, 2012

please update to 0.7.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment