Hi, there are some problems with your AjaxCallDecorator. You replace
the button conponent, so this.onclick_ doesn't really point anywhere
in onsuccess handler. Also there is a typo. I suggest using something
like this:

            protected IAjaxCallDecorator getAjaxCallDecorator() {
                return new IAjaxCallDecorator() {
                    public CharSequence decorateScript(CharSequence script) {
                        return "this.onclick_=this.onclick;
this.onclick=function() { return false; };" + script;
                    }
                    public CharSequence
decorateOnSuccessScript(CharSequence script) {
                        return "if (typeof(this.onclick_) !=
'undefined') this.onclick=this.onclick_;" + script;
                    }
                    public CharSequence
decorateOnFailureScript(CharSequence script) {
                        return "if (typeof(this.onclick_) != 'undefined')
this.onclick=this.onclick_;" + script;
                    }
                };
            }

With this code, I get no problem with IE (neither 6 or 7) and the
quickstart works well.

-Matej

On 9/10/07, Anthony J Webster <[EMAIL PROTECTED]> wrote:
> The quickstart (http://www.transcendenz.co.uk/quickstart.zip) that I built
> works fine in IE so that's not it.
> However I noticed the following in the Ajax Debug window :
>
> There seem to be 2 references to component id=feedback8
>
> .....
> INFO: Invoking pre-call handler(s)...
> INFO: Received ajax response (8138 characters)
> INFO:
> <ajax-response>
>     <component id="feedback8"><![CDATA[
>         <span id="feedback8">
>             <ul>
>                 <li class="feedbackPanelERROR">
>                     <span class="feedbackPanelERROR">Le formulaire comporte
> des erreurs</span>
>                 </li>
>             </ul>
>         </span>
>     ]]></component>
>
> and then again after a header-contribution chunk in the form chunk which
> encloses most of the code (it's a medium sized form so lots of
> label/field/feedback chunks). Feedback8 happens to be the general
> feedbaclPanel which shows errors occuring during submission.
>
> <component id="formu"><![CDATA[
>         <form id="formu"
> action="?wicket:interface=:1:patientpanel:patientform::IFormSubmitListener::"
> method="post">
>             <div style="display:none">
>                 <input type="hidden" name="formu_hf_0" id="formu_hf_0"/>
>             </div>
>             <fieldset>
>                 <p class="error">
>                     <span id="feedback8">
>                         <ul>
>                             <li class="feedbackPanelERROR">
>                                 <span class="feedbackPanelERROR">Le
> formulaire comporte des erreurs</span>
>                             </li>
>                         </ul>
>                     </span>
>                 </p>
> .....
>
> Could this be the cause?
>
> Thanks
>
> Anthony
>
> ----- Original Message -----
> From: "Matej Knopp" <[EMAIL PROTECTED]>
> To: <users@wicket.apache.org>
> Sent: Friday, September 07, 2007 4:16 PM
> Subject: Re: AjaxSubmitLink does nothing in IE
>
>
> > Could be related to markup, or parsing the response. Jira issue and
> > quickstart would help here.
> >
> > -Matej
> >
> > On 9/7/07, Anthony J Webster <[EMAIL PROTECTED]> wrote:
> >> That works fine. Thanks
> >> However I've just noticed that this AjaxSubmitLink doesn't do anything in
> >> IE
> >> whereas in Firefox it works.
> >> I check the Ajax debug window and the server *is* contacted and
> >> everything
> >> however after recieving the response I get an "ERROR: Error while parsing
> >> response: Unknown runtime error" in IE.
> >>
> >> Any Ideas?
> >>
> >> Many Thanks
> >>
> >> Anthony
> >>
> >> ----- Original Message -----
> >> From: "Matej Knopp" <[EMAIL PROTECTED]>
> >> To: <users@wicket.apache.org>
> >> Sent: Thursday, September 06, 2007 11:35 PM
> >> Subject: Re: Creating a disableable AjaxSubmitLink
> >>
> >>
> >> > Something like the following should work:
> >> >
> >> > decorateScript:
> >> > "this.onclick_=this.onclick; this.onclick=function() { return false;
> >> > };" + script;
> >> >
> >> > onSuccess,onFailureScript:
> >> > this.onclick=this.onclick_; + script;
> >> >
> >> > -Matej
> >> >
> >> > On 9/6/07, Anthony J Webster <[EMAIL PROTECTED]> wrote:
> >> >> Hi,
> >> >>
> >> >> I'm trying to create a disableable AjaxSubmitLink. When a user clicks
> >> >> on
> >> >> the link further clicks must not result in anything until the
> >> >> 'submission' is complete. This call be achieved by adding "return
> >> >> false;"
> >> >> in a call decorator. However I'm stuggling with the re-enabling. I
> >> >> need
> >> >> to strip the "return false" and put the original destination back.
> >> >>
> >> >> form.add(new AjaxSubmitLink("randomise", form) {
> >> >>
> >> >>             protected void onSubmit(AjaxRequestTarget target, Form
> >> >> form)
> >> >> {
> >> >>                somethingLong();
> >> >>             }
> >> >>             protected IAjaxCallDecorator getAjaxCallDecorator() {
> >> >>                 return new AjaxCallDecorator() {
> >> >>
> >> >>                     public CharSequence decorateScript(CharSequence
> >> >> script) {
> >> >>                         return "return false;" + script;
> >> >>                     }
> >> >>                     public CharSequence
> >> >> decorateOnSuccessScript(CharSequence script) {
> >> >>                         // NEED TO RESET TO PREVIOUS STATE
> >> >>                     }
> >> >>                     public CharSequence
> >> >> decorateOnFailureScript(CharSequence script) {
> >> >>                         // NEED TO RESET TO PREVIOUS STATE
> >> >>                     }
> >> >>                 };
> >> >>             }
> >> >>         });
> >> >>
> >> >> Any help would be most appreciated.
> >> >>
> >> >> Thanks in advance
> >> >>
> >> >> Anthony
> >> >
> >> > ---------------------------------------------------------------------
> >> > 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]
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > 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]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to