Thank you Martin,

I change the implementation to below and its working fine now.

Add this to Html
<div wicket:id="panel"> </div>

change the add(form) to

add(new Panel("panel", object));

the modal window is implemented in panel

For the purpose of checking, I will create the quickstart how it was
implemented before as you requested.



On 21 September 2014 16:45, Martin Grigorov <mgrigo...@apache.org> wrote:

> Hi,
>
> On Sun, Sep 21, 2014 at 10:48 AM, Ajayi Yinka <iamstyaj...@googlemail.com>
> wrote:
>
> > Hello everyone,
> >
> > submit method called more than one time trigering two modalWindows to
> open
> > at the same time.
> >
> > See snippet below. If I put the just only modal.show(target) in the
> > onsubmit method and others in Page constuctor, the problem still persist.
> >
> > I am using version 6.16.
> >
> > What am I doing wrong here? I will appreciate better way of doing this.
> >
> >
> > AjaxSubmitLink addButton = new AjaxSubmitLink("addButton") {
> >             @Override
> >             public void onSubmit(AjaxRequestTarget target,  Form form) {
> >                 // your stuff
> >                 if (target != null) {
> >
>
> target should be always non-null here
>
>
> >                     Object obj= new Object();
> >                     Object Panel panel = new
> > ObjectPanel(modalWindow.getContentId(), object);
> >                     modalWindow.setContent(panel);
> >                     modalWindow.setTitle("New Object");
> >                     //modalWindow.setEnabled(true);
> >                     //modalWindow.showUnloadConfirmation(true);
> >
> >                         modalWindow.show(target);
> >                         System.out.println("\n\nI am called
> > 1111111111111111111111111111111" + target.getLastFocusedElementId());
> >
> >                 }
> >             }
> >         };
> >
> >
> >         Form form = new Form("form");
> >
> >         form.add(modalWindow);
> >         form.add(addButton);
> >
> >
> The code looks OK to me. It shouldn't submit twice.
> Please create a quickstart app that we can debug and attach it to JIRA.
>
>
> >
> >
> > Thank you.
> >
> > --
> >
> > Ajayi S . Yinka
> > +2348022684477
> >
>



-- 

Ajayi S . Yinka
+2348022684477

Reply via email to