Google Groups Home
Help | Sign in
Subclassing Remote.Form
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Bill Burcham  
View profile
 More options 14 May, 17:04
From: Bill Burcham <bill.burc...@gmail.com>
Date: Wed, 14 May 2008 09:04:10 -0700 (PDT)
Local: Wed 14 May 2008 17:04
Subject: Subclassing Remote.Form
I have a few questions about subclassing Remote.Form. I want to
override onsubmit to do some validation and then call super's
onsubmit. So I derived from Remote.Form. Now the question:

* when I overrode onsubmit it wasn't getting called - only super's
onsubmit was called. Can I override onXX methods and expect them to
bind properly?

Which brings up another question: with Prototype, is it necessary to
explicitly invoke $super() in initialize to cause the superclass
initializer to be called - or is this behavior automatic? (should be
automatic I think) I tried it both ways (calling $super() in
initialize versus not calling it at all). Neither way caused my
onsubmit to bind. However failing to call $super() did seem to result
in an object that had not had Remote.Base initialize invoked
(this.options weren't set).

Guess I'm looking for Prototype best practice and then wondering
whether there is a particular problem subclassing lowpro Remote.Form.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dan Webb  
View profile
 More options 15 May, 14:41
From: "Dan Webb" <d...@danwebb.net>
Date: Thu, 15 May 2008 14:41:10 +0100
Local: Thurs 15 May 2008 14:41
Subject: Re: Subclassing Remote.Form

> * when I overrode onsubmit it wasn't getting called - only super's
> onsubmit was called. Can I override onXX methods and expect them to
> bind properly?

Yes, you should.  I regularly override onsubmit on Remote.Form.  I'll
set up a few tests to see whats going on.

> Which brings up another question: with Prototype, is it necessary to
> explicitly invoke $super() in initialize to cause the superclass
> initializer to be called

No, its not automatic.  You need to invoke $super if you want to do that.


--
Dan Webb
http://www.danwebb.net

aim: danwrong123
skype: danwrong


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bill Burcham  
View profile
 More options 15 May, 18:54
From: "Bill Burcham" <bill.burc...@gmail.com>
Date: Thu, 15 May 2008 10:54:24 -0700
Local: Thurs 15 May 2008 18:54
Subject: Re: Subclassing Remote.Form

> > Which brings up another question: with Prototype, is it necessary to
> > explicitly invoke $super() in initialize to cause the superclass
> > initializer to be called

> No, its not automatic.  You need to invoke $super if you want to do that.

That makes sense from the standpoint that unlike C++, we don't have static
analysis to tell us whether or not super's being explicitly invoked.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google