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]

Reply via email to