You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Alexander Cherednichenko <le...@gmail.com> on 2011/12/21 11:54:33 UTC

Modal window close behavior - should it hide content?

Hi guys!

Using wicket 1.4.18; experiencing a strange behavior.
I have a form, modal window in it (we are chaining them). This 'outer' form
has its own submit button. The content in modal window does have the form
too, with its own validators.
So, hierarchy looks like:

userForm with submit button <- Form (part of the ModalWindow markup) <-
Form inside modal window content <- validator.

Issue is that if i open the modal window, fail that validator inside form
inside content of MW, and then _close_ modal window, submission of the
outermost form fails with the validation of that validator!

I did check the stuff, looks like wicket tries to validate it as a nested
form, and thus fails. Weird thing is that innermost form is technically not
visible on the page, but visible in terms of wicket hierarchy.

I looked into the behavior of modal window on close, and it does _not_ hide
content however the show() method does setVisible(true) to it. Am i missing
something from the picture?

Here's MW's close listener (invoked directly from AJAX behavior):

protected final void respondOnWindowClosed(AjaxRequestTarget target)
 {
shown = false;

// should we cleanup the pagemap?
 if (deletePageMap == true)
{
// get the pagemap
 Session session = Session.get();
IPageMap pageMap = session.pageMapForName(getPageMapName(), false);

// if there is any remove it
if (pageMap != null)
{
 session.removePageMap(pageMap);
deletePageMap = false;
}
 }

if (windowClosedCallback != null)
{
 windowClosedCallback.onClose(target);
}
}


Thank you!
Regards,

-- 
Alexander Cherednichenko

[ the only way out is the way up ]