Hi all,

I'm encountering a MarkupNotFoundException when reusing a Wicket Bootstrap 
Modal.

Scenario:

    I have a reusable ModalWindow that displays different panels using 
setContent().
    Opening the first modal works correctly.
    If I click Save, everything works fine.
    If I click Cancel to close the modal and then open another modal (with a 
different panel), I get:

org.apache.wicket.markup.MarkupNotFoundException:
Failed to find markup file associated.
ProfilePanel [Component id = content]

(or ConfirmPanel, depending on which panel is opened next).

My setContent() implementation is:

public void setContent(ModalContent content)
{
    modalContainer.replace((Component) content);

    IModel<String> header = content.getHeader();
    if (header != null) {
        header(header);
    }

    Button button = content.createSaveButton(Modal.BUTTON_MARKUP_ID);
    if (button != null) {
        addButton(button);
    }
}

Both ProfilePanel and ConfirmPanel have valid corresponding .html files, and 
they work correctly when opened initially.

The exception only occurs after closing the previous modal using Cancel. It 
does not occur after Save.

Is there any cleanup required when a Wicket Bootstrap Modal is closed? For 
example, should the modal content or footer buttons be reset when the modal is 
hidden? Or is there a recommended pattern for reusing a Modal with different 
panel content?
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to