You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Kirk Israel <ki...@kisrael.com> on 2007/11/16 17:45:08 UTC
ModalWindow: open on page construction
Is there a way to get a ModalWindow to open up along with its
underlying page? The usual show() takes an AjaxRequestTarget ... I
have at least one work around in mind (ripping out the ModalWindow
into a separate object so the launching page could show it too) but it
would be more elegant to just modify the constructor so that it takes
a boolean causing the page to start with the dialog...
Thanks!
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: ModalWindow: open on page construction
Posted by Kirk Israel <ki...@kisrael.com>.
Not during, after the page has finished loading.
The useful aspect is this: most cool Ajax-y things people will have
made rely on having that AjaxRequestTarget handy (most often in the
onClick of a AjaxFallbackLink . There is a small, but real, number of
circumstances where you want to do one of those things as soon as the
page is done loading, rather than waiting for a user click. (And it
would be cleaner to not have to manually call the javascript onClick,
but keep it in the Java)
My example, again, is a ModalWindow. Ideally I would have liked an
upload button on our "view mode" page take the user to the edit mode
page, and then have the edit mode fire off its upload ModalWindow.
(the Edit Page already had its own Upload button). Instead, after
trying a few things out, I was compelled to give the View Mode page
its own Upload dialog, though I exposed what the Edit page was doing
to make the window, so there wasn't TOO too much duplication. Then, on
the ModalWindows onclose, it called the Edit Page's routine for what
to do when the ModalWindow closed, and then jumped to the Edit Page.
This made I had to create an instance of the Edit Page earlier than I
wanted to...
But if I had something like
onPageDoneLoading(AjaxRequestTarget pArt) function, I could have used
that in Edit Page to check a boolean, and then open up its own Modal
Window.
Thanks for at least thinking about my issue :-)
-Kirk
On Nov 17, 2007 1:47 PM, Matej Knopp <ma...@gmail.com> wrote:
> No, there is no such thing as having ajax request target during page
> load. What would it do, anyway?
>
> What we could do is making ModalWindow.getWindowOpenJavascript public,
> so that you could use the resuling javascript in
> IHeaderResponse.renderOnDomReadyJavascript().
>
> -Matej
>
>
> On Nov 16, 2007 7:50 PM, Kirk Israel <ki...@kisrael.com> wrote:
> > So my back up plans didn't work out as well as I had hoped.
> >
> > Is there any answer to this?
> >
> > Obviously, it would be lovely if there was some equivalent of the
> > javascript body onLoad command (and maybe tied in with that) that
> > could give the user an AjaxRequestTarget to play with... Is there
> > anything like that around?
> >
> >
> >
> > On Nov 16, 2007 11:49 AM, Kirk Israel <ki...@kisrael.com> wrote:
> > > (Sorry, I should have added I found the September discussion, I
> > > wondered if there was a more elegant solution in the meanwhile...)
> > >
> > >
> > > On Nov 16, 2007 11:45 AM, Kirk Israel <ki...@kisrael.com> wrote:
> > > > Is there a way to get a ModalWindow to open up along with its
> > > > underlying page? The usual show() takes an AjaxRequestTarget ... I
> > > > have at least one work around in mind (ripping out the ModalWindow
> > > > into a separate object so the launching page could show it too) but it
> > > > would be more elegant to just modify the constructor so that it takes
> > > > a boolean causing the page to start with the dialog...
> > > >
> > > > Thanks!
> > > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
AW: ModalWindow: open on page construction
Posted by Stefan Lindner <li...@visionet.de>.
This would be a great benefit for mee too. I have the same problem and I currently use a self updateing Timer to trigger an AjaxRequestTarget to open the modal window.
Stefan
-----Ursprüngliche Nachricht-----
Von: Matej Knopp [mailto:matej.knopp@gmail.com]
Gesendet: Samstag, 17. November 2007 19:48
An: users@wicket.apache.org
Betreff: Re: ModalWindow: open on page construction
No, there is no such thing as having ajax request target during page load. What would it do, anyway?
What we could do is making ModalWindow.getWindowOpenJavascript public, so that you could use the resuling javascript in IHeaderResponse.renderOnDomReadyJavascript().
-Matej
On Nov 16, 2007 7:50 PM, Kirk Israel <ki...@kisrael.com> wrote:
> So my back up plans didn't work out as well as I had hoped.
>
> Is there any answer to this?
>
> Obviously, it would be lovely if there was some equivalent of the
> javascript body onLoad command (and maybe tied in with that) that
> could give the user an AjaxRequestTarget to play with... Is there
> anything like that around?
>
>
>
> On Nov 16, 2007 11:49 AM, Kirk Israel <ki...@kisrael.com> wrote:
> > (Sorry, I should have added I found the September discussion, I
> > wondered if there was a more elegant solution in the meanwhile...)
> >
> >
> > On Nov 16, 2007 11:45 AM, Kirk Israel <ki...@kisrael.com> wrote:
> > > Is there a way to get a ModalWindow to open up along with its
> > > underlying page? The usual show() takes an AjaxRequestTarget ...
> > > I have at least one work around in mind (ripping out the
> > > ModalWindow into a separate object so the launching page could
> > > show it too) but it would be more elegant to just modify the
> > > constructor so that it takes a boolean causing the page to start with the dialog...
> > >
> > > Thanks!
> > >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: ModalWindow: open on page construction
Posted by Matej Knopp <ma...@gmail.com>.
No, there is no such thing as having ajax request target during page
load. What would it do, anyway?
What we could do is making ModalWindow.getWindowOpenJavascript public,
so that you could use the resuling javascript in
IHeaderResponse.renderOnDomReadyJavascript().
-Matej
On Nov 16, 2007 7:50 PM, Kirk Israel <ki...@kisrael.com> wrote:
> So my back up plans didn't work out as well as I had hoped.
>
> Is there any answer to this?
>
> Obviously, it would be lovely if there was some equivalent of the
> javascript body onLoad command (and maybe tied in with that) that
> could give the user an AjaxRequestTarget to play with... Is there
> anything like that around?
>
>
>
> On Nov 16, 2007 11:49 AM, Kirk Israel <ki...@kisrael.com> wrote:
> > (Sorry, I should have added I found the September discussion, I
> > wondered if there was a more elegant solution in the meanwhile...)
> >
> >
> > On Nov 16, 2007 11:45 AM, Kirk Israel <ki...@kisrael.com> wrote:
> > > Is there a way to get a ModalWindow to open up along with its
> > > underlying page? The usual show() takes an AjaxRequestTarget ... I
> > > have at least one work around in mind (ripping out the ModalWindow
> > > into a separate object so the launching page could show it too) but it
> > > would be more elegant to just modify the constructor so that it takes
> > > a boolean causing the page to start with the dialog...
> > >
> > > Thanks!
> > >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: ModalWindow: open on page construction
Posted by Kirk Israel <ki...@kisrael.com>.
So my back up plans didn't work out as well as I had hoped.
Is there any answer to this?
Obviously, it would be lovely if there was some equivalent of the
javascript body onLoad command (and maybe tied in with that) that
could give the user an AjaxRequestTarget to play with... Is there
anything like that around?
On Nov 16, 2007 11:49 AM, Kirk Israel <ki...@kisrael.com> wrote:
> (Sorry, I should have added I found the September discussion, I
> wondered if there was a more elegant solution in the meanwhile...)
>
>
> On Nov 16, 2007 11:45 AM, Kirk Israel <ki...@kisrael.com> wrote:
> > Is there a way to get a ModalWindow to open up along with its
> > underlying page? The usual show() takes an AjaxRequestTarget ... I
> > have at least one work around in mind (ripping out the ModalWindow
> > into a separate object so the launching page could show it too) but it
> > would be more elegant to just modify the constructor so that it takes
> > a boolean causing the page to start with the dialog...
> >
> > Thanks!
> >
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: ModalWindow: open on page construction
Posted by Kirk Israel <ki...@kisrael.com>.
(Sorry, I should have added I found the September discussion, I
wondered if there was a more elegant solution in the meanwhile...)
On Nov 16, 2007 11:45 AM, Kirk Israel <ki...@kisrael.com> wrote:
> Is there a way to get a ModalWindow to open up along with its
> underlying page? The usual show() takes an AjaxRequestTarget ... I
> have at least one work around in mind (ripping out the ModalWindow
> into a separate object so the launching page could show it too) but it
> would be more elegant to just modify the constructor so that it takes
> a boolean causing the page to start with the dialog...
>
> Thanks!
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org