Re: AjaxSubmitLink does nothing in IE

2007-09-10 Thread Matej Knopp
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:
> 
> 
>
> 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.
>
> 

Re: AjaxSubmitLink does nothing in IE

2007-09-10 Thread Anthony J Webster
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:

   

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.



Re: AjaxSubmitLink does nothing in IE

2007-09-07 Thread Igor Vaynberg
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?


well clearly according to the message there is an unknown error!

-igor



Many Thanks
>
> Anthony
>
> - Original Message -
> From: "Matej Knopp" <[EMAIL PROTECTED]>
> To: 
> 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]
>
>


Re: AjaxSubmitLink does nothing in IE

2007-09-07 Thread Matej Knopp
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: 
> 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]



AjaxSubmitLink does nothing in IE

2007-09-07 Thread Anthony J Webster

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: 
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]