You cannot show a modal window directly from a page/component constructor.
It needs a valid AjaxRequestTarget, giving it a new ART is not going to work.
In the construcor you should simply add the modalwindow to your
page/component and then use a real ajax request to show it. You can
add an IHeaderContributor or overwrite renderHead to trigger an
ajaxcall as soon as the page is loaded by the browser.
Maurice
On Fri, Apr 25, 2008 at 7:30 AM, freak182 <[EMAIL PROTECTED]> wrote:
>
> Hello,
> Im having problem from a modal window loading before a page, is this
> possible? because when try this:
>
> public class BasePage extends WebPage {
> public BasePage(){
> if(_isLoadable) modalWindow.show(new AjaxRequestTarget(this));
> }
> }
>
>
> ERROR - RequestCycle - This component is not (yet) coupled to
> a page. It has to be able to find the page it is supposed to operate in
> before you can call this method (Component#getMarkupId)
> org.apache.wicket.WicketRuntimeException: This component is not (yet)
> coupled to a page. It has to be able to find the page it is supposed to
> operate in before you can call this method (Component#getMarkupId)
> at org.apache.wicket.Component.nextAutoIndex(Component.java:1380)
> at org.apache.wicket.Component.getMarkupId(Component.java:1422)
> at org.apache.wicket.Component.getMarkupId(Component.java:1468)
> at
>
> org.apache.wicket.ajax.AjaxRequestTarget.addComponent(AjaxRequestTarget.java:344)
> at
>
> org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow.show(ModalWindow.java:278)
> -------
>
> Thanks a lot..Cheers
> --
> View this message in context:
> http://www.nabble.com/Load-Modal-Window-before-the-page-loads-tp16890707p16890707.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]