Hi,
A colleague of mine wanted to do the same just last week. He ended up
dropping modal window, and the problem was solved in a different way, so
there are use-cases for this functionality.
(ours was: popping a modal window for user to accept/decline a
pre-defined profile image on first visit/until choice made.)
p.s.: Ernesto, thanks for sharing your code!
Regards,
Peter
2010-11-23 16:24 keltezéssel, Martin Grigorov írta:
Wiki page is OK for now.
1) it is easy to create if needed
2) I don't remember such request in the mailing lists for the last 2 years,
so it is not something everyone needs
My 2c.
On Tue, Nov 23, 2010 at 4:16 PM, Ernesto Reinaldo Barreiro<
[email protected]> wrote:
Hi,
In one of the application we working at right now we have the
requirement that the user should fill in some extra information before
he/she is allowed to work with some pages. We wanted to do this with a
modal window blocking the page till this information is provided. So,
the requirement is:
-Modal window should be opened immediately after a page is load.
After a bit of messing around/googling we came up with this class, who
seems to be doing the job:-)
public class OpenOnLoadModalWindow extends ModalWindow implements
IHeaderContributor {
private static final long serialVersionUID = 1L;
/**
* @param id
*/
public OpenOnLoadModalWindow(String id) {
super(id);
}
/**
* @param id
* @param model
*/
public OpenOnLoadModalWindow(String id, IModel<?> model) {
super(id, model);
}
/**
* Adds the JavaScript to initially open modal window.
*/
public void renderHead(IHeaderResponse response)
{
response.renderOnDomReadyJavascript(getWindowOpenJavascript());
}
/*
* (non-Javadoc)
* @see
org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow#makeContentVisible()
*/
@Override
protected boolean makeContentVisible()
{
return true;
}
}
Would this class, or one derived form this one, or a better solution
if one is known:), be included on the framework. Or this is just a
topic for wiki page?
Regards,
Ernesto
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]