I put a breakpoint on dispatchException and it hits that with the
following:
TypeError: element.hasClassName is not a function
message=element.hasClassName is not a function.
The line that triggered the exception is in prototype.js line 1322
(Latest Prototype.js 1.6.0.3)
However, I also get this even if I don't have any Ajax responders set
up.
On Nov 28, 10:24 am, Cameron McCloud <[EMAIL PROTECTED]>
wrote:
> Strangely enough when the focus is on the auto complete edit field in
> Firefox and I ALT-TAB to my editor, another AJAX request is made, but
> this time the onComplete gets called and I get the alert message box
>
> On Nov 28, 10:21 am, Frederick Cheung <[EMAIL PROTECTED]>
> wrote:
>
> > On Nov 28, 10:16 am, Cameron McCloud <[EMAIL PROTECTED]>
> > wrote:> When I CTRL-F5 to start off afresh, the Ajax.activeRequestCount is
> > 0.
>
> > > If I type in my name very slowly into the edit box, the count is now 7
> > > - it is never decremented. When my code is running normally (i.e. I'm
> > > not deliberately forcing errors), the count always returns to zero.
>
> > So it's not just your responder :-) Is your 'normal' onComplete
> > throwing an exception a possibility ? ( you could put a breakpoint in
> > dispatchException).
>
> > Fred
>
> > > On Nov 28, 9:48 am, Frederick Cheung <[EMAIL PROTECTED]>
> > > wrote:
>
> > > > On Nov 28, 8:48 am, Cameron McCloud <[EMAIL PROTECTED]> wrote:> The
> > > > last bit should have read:
>
> > > > > For auto_complete, the onCreate callback gets invoked, but the
> > > > > onComplete one never does. I've checked this in Firebug - I can see
> > > > > the 404 or 500 POST errors, but the onComplete responder never kicks
> > > > > in.
>
> > > > That's weird. Prototype itself uses that to maintain the value of
> > > > Ajax.activeRequestCount
> > > > Is that value going up and down as it should?
> > > > If you look at the code, one thing that would screw this over would be
> > > > if the onComplete callback for that particular request threw an
> > > > exception
>
> > > > Fred
>
> > > > > On Nov 28, 8:43 am, Cameron McCloud <[EMAIL PROTECTED]> wrote:
>
> > > > > > Hi,
>
> > > > > > I have a simple example in Rails 2.1.2, 2.2.2 using the
> > > > > > auto_complete
> > > > > > plugin. It works wonderfully. However, I was wondering how it would
> > > > > > handle errors. For example, if for some reason a person couldn't be
> > > > > > found, the HTTP request will come back with a 404
>
> > > > > > def auto_complete_for_people_foo
> > > > > > # Cause a deliberate error
> > > > > > people = Person.find(22222) # doesn't
> > > > > > exist
> > > > > > . . .
> > > > > > end
>
> > > > > > Or there might be a syntax error in the code and we get a 500 error
> > > > > > back.
>
> > > > > > def auto_complete_for_people_foo
> > > > > > # Cause a deliberate error
> > > > > > asflksajflasjlf #
> > > > > > Not valid Ruby code
> > > > > > . . .
> > > > > > end
>
> > > > > > For other AJAX functionality in our application (e.g.
> > > > > > form_remote_tag)
> > > > > > we have global AJAX repsonders as follows:
>
> > > > > > Ajax.Responders.register({
> > > > > > onComplete: function(transport) {
> > > > > > console.info("COMPLETE");
> > > > > > Element.hide('spinner');
> > > > > > if (transport.transport.status == 0 ||
> > > > > > transport.transport.status ==
> > > > > > 12029) {
> > > > > > // Lost connection as reported in Firefox
> > > > > > (0) or IE (12029)
> > > > > > alert("The connection with the server has
> > > > > > been lost.");
> > > > > > console.info("LOST CONNECTION");
> > > > > > } else if (transport.transport.status != 200 ) {
> > > > > > alert(String.format("The server has
> > > > > > reported an error with code
> > > > > > {0}", transport.transport.status));
> > > > > > console.info("ERROR");
> > > > > > }
> > > > > > },
> > > > > > onCreate: function() {
> > > > > > Element.show('spinner');
> > > > > > console.info("LOADING...");
> > > > > > }
>
> > > > > > });
>
> > > > > > For auto_complete, the onCreate callback gets invoked, but the
> > > > > > onComplete one never does. I've checked this in Firebug - I can see
> > > > > > the 404 or 500 POST errors, but I the
>
> > > > > > Does anyone have any ideas or areas they can point me to?
>
> > > > > > TIA
>
> > > > > > Cam.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---