I wasn't able to reuse a ModalWindow object in my projects. I always had to
build it again. I obviously must be doing something wrong if you managed to
do exactly this.

Anyways, this is the output of the javascript debug window when using the
code Marieke initially wrote (it doesn't give me any clues):

*NFO: *focus set on linkOpen2*INFO: *
*INFO: *
Initiating Ajax GET request on
;jsessionid=DC1CC910C0903823CB6D89780AA63227?wicket:interface=:0:linkOpen::IBehaviorListener:0:&random=0.8450107536275825
*INFO: *Invoking pre-call handler(s)...
*INFO: *Received ajax response (1678 characters)
*INFO: *
<?xml version="1.0"
encoding="UTF-8"?><ajax-response><header-contribution
encoding="wicket1" ><![CDATA[<head xmlns:wicket="
http://wicket.apache.org";><script type="text/javascript"
src="resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js"></script>

<script type="text/javascript"
src="resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js"></script>

<script type="text/javascript"
src="resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax-debug.js"></script>

<script type="text/javascript"
id="wicket-ajax-debug-enable"><!--/*--><![CDATA[/*><!--*/
wicketAjaxDebugEnable=true;
/*-->]^]^>*/</script>

<script type="text/javascript"
src="resources/org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow/res/modal.js"></script>

<link rel="stylesheet" type="text/css"
href="resources/org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow/res/modal.css"
/>

</head>]]></header-contribution><component id="dataChooser1"
><![CDATA[<div id="dataChooser1" style="display:none">
    <div id="content3">
    </div>
</div>]]></component><evaluate><![CDATA[var settings = new Object();
settings.minWidth=200;
settings.minHeight=200;
settings.className="w_blue";
settings.width="600";
settings.height="400";
settings.resizable=true;
settings.src="?wicket:interface=:1::::";
settings.iframeName="modal-dialog-pagemap";
settings.mask="semi-transparent";
settings.onClose = function() { var
wcall=wicketAjaxGet('?wicket:interface=:0:dataChooser::IBehaviorListener:1:-1',null,null,
function() {return Wicket.$('dataChooser1') != null;}.bind(this)); };
Wicket.Window.create(settings).show();
]]></evaluate></ajax-response>
*INFO: *Response parsed. Now invoking steps...
*INFO: *
*INFO: *
Initiating Ajax GET request on
resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js
*INFO: *Invoking pre-call handler(s)...
*INFO: *Received ajax response (6062 characters)
*INFO: *Invoking post-call handler(s)...
*INFO: *
*INFO: *
Initiating Ajax GET request on
resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js
*INFO: *Invoking pre-call handler(s)...
*INFO: *Received ajax response (60129 characters)
*INFO: *Invoking post-call handler(s)...
*INFO: *
*INFO: *
Initiating Ajax GET request on
resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax-debug.js
*INFO: *Invoking pre-call handler(s)...
*INFO: *Received ajax response (8183 characters)
*INFO: *Invoking post-call handler(s)...
*INFO: *
*INFO: *
Initiating Ajax GET request on
resources/org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow/res/modal.js
*INFO: *Invoking pre-call handler(s)...
*INFO: *Received ajax response (41693 characters)
*INFO: *Invoking post-call handler(s)...
*INFO: *Response processed successfully.
*INFO: *Invoking post-call handler(s)...
*INFO: *last focus id was not set
*INFO: *focus set on
*INFO: *focus removed from
*INFO: *
*INFO: *
Initiating Ajax GET request on
?wicket:interface=:0:dataChooser::IBehaviorListener:1:-1&random=0.8103637903503486
*INFO: *Invoking pre-call handler(s)...
*INFO: *Received ajax response (69 characters)
*INFO: *
<?xml version="1.0" encoding="UTF-8"?><ajax-response></ajax-response>
*INFO: *Response parsed. Now invoking steps...
*INFO: *Response processed successfully.
*INFO: *Invoking post-call handler(s)...
*INFO: *last focus id was not set
*INFO: *focus set on linkOpen2
*INFO: *
*INFO: *
Initiating Ajax GET request on
;jsessionid=DC1CC910C0903823CB6D89780AA63227?wicket:interface=:0:linkOpen::IBehaviorListener:0:&random=0.6139253992868053
*INFO: *Invoking pre-call handler(s)...
*INFO: *Received ajax response (69 characters)
*INFO: *
<?xml version="1.0" encoding="UTF-8"?><ajax-response></ajax-response>
*INFO: *Response parsed. Now invoking steps...
*INFO: *Response processed successfully.
*INFO: *Invoking post-call handler(s)...
*INFO: *Calling focus on linkOpen2
*INFO: *focus removed from linkOpen2

Cristi Manole

On Tue, Apr 29, 2008 at 9:51 AM, Johan Compagner <[EMAIL PROTECTED]>
wrote:

> We reuse the dialog constantly, so i dont know what goes wrong for
> you. What does the javascript debug window tell you?
> Maybe the modal window some things that is is still shown
>
> On 4/29/08, Marieke Vandamme <[EMAIL PROTECTED]> wrote:
> >
> > Hello,
> > Thanks for the reply.
> > But isn't it possible to reuse the modalwindow? Because in my
> application
> > the window needs to be opened many times, and I thought it would be
> better
> > to reuse the same window multiple times. Or has that no affect to the
> > memory-usage?
> >
> >
> > Cristi Manole wrote:
> > >
> > > I am 99% certain that if you change your code from :
> > >
> > > *final MyChooser myChooser = new MyChooser(modal);*
> > > *modal.setPageCreator(new ModalWindow.PageCreator() {
> > >  public Page createPage() {
> > >                return myChooser;
> > >            }
> > > }
> > > *
> > > to this :
> > >
> > > *modal.setPageCreator(new ModalWindow.PageCreator() {
> > >  public Page createPage() {
> > >                return new MyChooser(modal);
> > >            }
> > > }
> > > *
> > > it will work.
> > >
> > > Try it.
> > > Cristi Manole
> > >
> > > On Mon, Apr 28, 2008 at 1:07 PM, Marieke Vandamme <[EMAIL PROTECTED]>
> wrote:
> > >
> > >>
> > >> Hello,
> > >>
> > >> can't anyone help me with this problem?
> > >> If I need to code it differently, please tell me.
> > >> Thanks !!
> > >>
> > >>
> > >> Marieke Vandamme wrote:
> > >> >
> > >> > Hello,
> > >> >
> > >> > i'm having problems with the modal window. It shows up fine when I
> > >> click
> > >> > my link the first time, but after closing the window with the 'X',
> it
> > >> > won't open again.
> > >> > I don't know if I'm using it wrong or if it's a bug.
> > >> > Any help is welcome ! thanks. Marieke.
> > >> >
> > >> > My code :
> > >> > public class TestModalWindow extends WebPage {
> > >> >
> > >> >     public TestModalWindow() {
> > >> >         final ModalWindow modal = new ModalWindow("dataChooser");
> > >> >         add(modal);
> > >> >         final MyChooser myChooser = new MyChooser(modal);
> > >> >         modal.setPageCreator(new ModalWindow.PageCreator() {
> > >> >
> > >> >             public Page createPage() {
> > >> >                 return myChooser;
> > >> >             }
> > >> >             });
> > >> >
> > >> >          add(new AjaxLink("lnkOpen") {
> > >> >
> > >> >                 public void onClick(AjaxRequestTarget target) {
> > >> >                     myChooser.reload(target);
> > >> >                 }
> > >> >             });
> > >> >     }
> > >> >
> > >> >     public class MyChooser extends WebPage {
> > >> >
> > >> >         private ModalWindow window;
> > >> >
> > >> >         public MyChooser(ModalWindow w) {
> > >> >             this.window = w;
> > >> >         }
> > >> >
> > >> >         public void reload(AjaxRequestTarget target) {
> > >> >             this.window.show(target);
> > >> >         }
> > >> >     }
> > >> > }
> > >> >
> > >>
> > >> --
> > >> View this message in context:
> > >>
> >
> http://www.nabble.com/Modal-Window-not-opening-the-second-time-tp16850180p16935903.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]
> > >>
> > >>
> > >
> > >
> >
> > --
> > View this message in context:
> >
> http://www.nabble.com/Modal-Window-not-opening-the-second-time-tp16850180p16953499.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]
>
>

Reply via email to