You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Thies Edeling <te...@gmail.com> on 2007/12/16 13:05:55 UTC
Re: ModalWindow bug - unable to close when added AjaxButton in content of the window
Was there any resolution for this? I have the same thing with rc2 with a
valid form. From the javascript console:
*INFO: *
Initiating Ajax POST request on ../../?wicket:interface=:4:39:::0:2&random=
0.745044540904514
*INFO: *Invoking pre-call handler(s)...
*INFO: *Received ajax response (457 characters)
*INFO: *
<?xml version="1.0
" encoding="UTF-8"?><ajax-response><evaluate><![CDATA[var win;
try {
win = window.parent.Wicket.Window;
} catch (ignore) {
}
if (typeof(win) == "undefined" || typeof(win.current) == "undefined") {
try {
win = window.Wicket.Window;
} catch (ignore) {
}
}
if (typeof(win) != "undefined" && typeof(win.current) != "undefined") {
window.parent.setTimeout(function() {
win.current.close();
}, 0);
}]]></evaluate></ajax-response>
*INFO: *Response parsed. Now invoking steps...
*ERROR: *Exception evaluating javascript: TypeError:
window.parent.setTimeout is not a function
On Sep 20, 2007 9:58 AM, Vit Rozkovec <wi...@rozkovec.info> wrote:
> Yes, the form validates, I put the breakpoint at onSubmit and that
> method was invoked.
> I tried it also with empty form.
> The behavior is following:
> when I have only AjaxLinks in the form, it is ok.
> When I add AjaxButton, the behavior changes - the first time the modal
> window is displayed, it is possible to close the window with the cross
> in the upper right corner and with any AjaxLink I have in the form. But
> only when the first click goes to one of these elements.
> When I first click on the button to close the window, suddently the
> cross and the links became dead too.
>
> Vitek
>
> Matej Knopp wrote:
> > Are you sure your Form validates, when you click AjaxLink? Because
> > otherwise the onSubmit is not invoked. Can you put a breakpoint in
> > onSubmit? Also there is onError handler that is invoked when form
> > validation fails.
> >
> > -Matej
> >
> > On 9/14/07, Vit Rozkovec <wi...@rozkovec.info> wrote:
> >
> >> I am sorry, I could not replicate it in quickstart. The button works
> >> fine there. For now I solved the problem by replacing AjaxButtons with
> >> AjaxLinks.
> >>
> >> Vitek
> >>
> >> Matej Knopp wrote:
> >>
> >>> Plase create a jira issue and attach a quickstart to it. Thanks.
> >>>
> >>> -Matej
> >>>
> >>> On 9/13/07, Vit Rozkovec <wi...@rozkovec.info> wrote:
> >>>
> >>>
> >>>> Good day,
> >>>> I am using last snapshot of wicket and there is a problem with modal
> >>>> window - I create instance of the window and add it to the page. As a
> >>>> content I use a panel which has these components:
> >>>>
> >>>> public class ModalConfirmationPanel extends Panel {
> >>>>
> >>>> public ModalConfirmationPanel(String id, final ModalWindow
> window) {
> >>>> super(id);
> >>>>
> >>>> window.setTitle(getString("titulek"));
> >>>>
> >>>> Form form = new Form("confirmation");
> >>>> add(form);
> >>>> form.add(new TextArea("explanation", new Model("")));
> >>>> form.add(new AjaxLink("ok") {
> >>>> @Override
> >>>> public void onClick(AjaxRequestTarget target) {
> >>>> window.close(target);
> >>>> }
> >>>> });
> >>>> form.add(new AjaxLink("storno") {
> >>>> @Override
> >>>> public void onClick(AjaxRequestTarget target) {
> >>>> window.close(target);
> >>>> }
> >>>> });
> >>>> // form.add(new AjaxSubmitButton("buttonOk", form) {
> >>>> // @Override
> >>>> // protected void onSubmit(AjaxRequestTarget target, Form
> form) {
> >>>> // window.close(target);
> >>>> // }
> >>>> // });
> >>>> // form.add(new AjaxButton("buttonStorno", form) {
> >>>> // @Override
> >>>> // protected void onSubmit(AjaxRequestTarget target, Form
> form) {
> >>>> // window.close(target);
> >>>> // }
> >>>> // });
> >>>>
> >>>>
> >>>> When I uncomment the lines and add AjaxSubmitButtons or AjaxButtons,
> the
> >>>> modal window cannot be closed anymore, neither with the buttons, nor
> >>>> with the close button in the header or with links. When I add just
> >>>> links, it works ok. It does not matter if there is window.close()
> method
> >>>> in the button's onSubmit method.
> >>>>
> >>>> If you would like I can make a quickstart. I cannot test anymore, but
> in
> >>>> beta3 it worked.
> >>>>
> >>>> Vitek
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> 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
> >>
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
>
Re: ModalWindow bug - unable to close when added AjaxButton in content
of the window
Posted by Thies Edeling <th...@rrm.net>.
never mind, seems it's the same as
https://issues.apache.org/jira/browse/WICKET-1003
Thies Edeling wrote:
> Was there any resolution for this? I have the same thing with rc2 with a
> valid form. From the javascript console:
>
> *INFO: *
> Initiating Ajax POST request on ../../?wicket:interface=:4:39:::0:2&random=
> 0.745044540904514
> *INFO: *Invoking pre-call handler(s)...
> *INFO: *Received ajax response (457 characters)
> *INFO: *
> <?xml version="1.0
> " encoding="UTF-8"?><ajax-response><evaluate><![CDATA[var win;
> try {
> win = window.parent.Wicket.Window;
> } catch (ignore) {
> }
> if (typeof(win) == "undefined" || typeof(win.current) == "undefined") {
> try {
> win = window.Wicket.Window;
> } catch (ignore) {
> }
> }
> if (typeof(win) != "undefined" && typeof(win.current) != "undefined") {
> window.parent.setTimeout(function() {
> win.current.close();
> }, 0);
> }]]></evaluate></ajax-response>
> *INFO: *Response parsed. Now invoking steps...
> *ERROR: *Exception evaluating javascript: TypeError:
> window.parent.setTimeout is not a function
>
>
> On Sep 20, 2007 9:58 AM, Vit Rozkovec <wi...@rozkovec.info> wrote:
>
>
>> Yes, the form validates, I put the breakpoint at onSubmit and that
>> method was invoked.
>> I tried it also with empty form.
>> The behavior is following:
>> when I have only AjaxLinks in the form, it is ok.
>> When I add AjaxButton, the behavior changes - the first time the modal
>> window is displayed, it is possible to close the window with the cross
>> in the upper right corner and with any AjaxLink I have in the form. But
>> only when the first click goes to one of these elements.
>> When I first click on the button to close the window, suddently the
>> cross and the links became dead too.
>>
>> Vitek
>>
>> Matej Knopp wrote:
>>
>>> Are you sure your Form validates, when you click AjaxLink? Because
>>> otherwise the onSubmit is not invoked. Can you put a breakpoint in
>>> onSubmit? Also there is onError handler that is invoked when form
>>> validation fails.
>>>
>>> -Matej
>>>
>>> On 9/14/07, Vit Rozkovec <wi...@rozkovec.info> wrote:
>>>
>>>
>>>> I am sorry, I could not replicate it in quickstart. The button works
>>>> fine there. For now I solved the problem by replacing AjaxButtons with
>>>> AjaxLinks.
>>>>
>>>> Vitek
>>>>
>>>> Matej Knopp wrote:
>>>>
>>>>
>>>>> Plase create a jira issue and attach a quickstart to it. Thanks.
>>>>>
>>>>> -Matej
>>>>>
>>>>> On 9/13/07, Vit Rozkovec <wi...@rozkovec.info> wrote:
>>>>>
>>>>>
>>>>>
>>>>>> Good day,
>>>>>> I am using last snapshot of wicket and there is a problem with modal
>>>>>> window - I create instance of the window and add it to the page. As a
>>>>>> content I use a panel which has these components:
>>>>>>
>>>>>> public class ModalConfirmationPanel extends Panel {
>>>>>>
>>>>>> public ModalConfirmationPanel(String id, final ModalWindow
>>>>>>
>> window) {
>>
>>>>>> super(id);
>>>>>>
>>>>>> window.setTitle(getString("titulek"));
>>>>>>
>>>>>> Form form = new Form("confirmation");
>>>>>> add(form);
>>>>>> form.add(new TextArea("explanation", new Model("")));
>>>>>> form.add(new AjaxLink("ok") {
>>>>>> @Override
>>>>>> public void onClick(AjaxRequestTarget target) {
>>>>>> window.close(target);
>>>>>> }
>>>>>> });
>>>>>> form.add(new AjaxLink("storno") {
>>>>>> @Override
>>>>>> public void onClick(AjaxRequestTarget target) {
>>>>>> window.close(target);
>>>>>> }
>>>>>> });
>>>>>> // form.add(new AjaxSubmitButton("buttonOk", form) {
>>>>>> // @Override
>>>>>> // protected void onSubmit(AjaxRequestTarget target, Form
>>>>>>
>> form) {
>>
>>>>>> // window.close(target);
>>>>>> // }
>>>>>> // });
>>>>>> // form.add(new AjaxButton("buttonStorno", form) {
>>>>>> // @Override
>>>>>> // protected void onSubmit(AjaxRequestTarget target, Form
>>>>>>
>> form) {
>>
>>>>>> // window.close(target);
>>>>>> // }
>>>>>> // });
>>>>>>
>>>>>>
>>>>>> When I uncomment the lines and add AjaxSubmitButtons or AjaxButtons,
>>>>>>
>> the
>>
>>>>>> modal window cannot be closed anymore, neither with the buttons, nor
>>>>>> with the close button in the header or with links. When I add just
>>>>>> links, it works ok. It does not matter if there is window.close()
>>>>>>
>> method
>>
>>>>>> in the button's onSubmit method.
>>>>>>
>>>>>> If you would like I can make a quickstart. I cannot test anymore, but
>>>>>>
>> in
>>
>>>>>> beta3 it worked.
>>>>>>
>>>>>> Vitek
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> 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
>>>>
>>>>
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> 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