Will,
That explains it.
You get forced to go for option 2 if you want to subclass the elements
of a page rather than CSpPage. For example, you may want to subclass
CSpRepeated so that it does some additional work for you. In your page,
you may have repeated1, repeated2 etc. So you don't have the option of
method overriding, since you can't go on coding
repeated1_onBeforeHemlOutput,
repeated2_onBeforeHtmlOutput() etc in the CSpRepeatedBase class.
Regards,
Aby
-----Original Message-----
From: Grace Frederick [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 06, 1999 7:29 AM
To: [EMAIL PROTECTED]
Subject: Re: [ND] Visual Inheritance possible ?
There are two approaches to creating superclasses.
1. Create the class with events such as "this_onBeforeDisplayEvent".
In
this case, ND uses introspection and automatically registers the events
for
the appropriate listeners.
2. Create the class with events such as "onBeforeDisplayEvent". In
this
case, you have to add the code to register the class for the appropriate
listener.
In ND3, I always use the first approach. In ND4, I typically use the
second
approach. Both work, though.
-- Grace
William Jaynes <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I'm working with ND4. As Aby suggests I've got a myBaseCalss which
> extends CSpPage. All my project pages inherit from myBaseClass.
However,
> I haven't done anything with regard to ISpDisplayListener or
> ISpHtmlOutputListener. myBaseClass simply extends CSpPage, and has
some
> methods defined (like this_onBeforeLoadEvent). My project pages seem
to
> work fine, and the default methods from myBaseClass get called as I
> would expect.
>
> Aby and Curt suggest I need to add some listener related code, but my
> code as is seems to work as I'd expect. What am I not understanding
> here?
>
> - Will
>
> Aby Mathew wrote:
> >
> > This is verymuch possible in ND and is used very commonly.
> >
> > All you need is a class inherited from CSpPage which is packaged in
the
> > same package as the project itself, and for each page in the project
set
> > the 'superclass' property to myProject.myBasePage.
> >
> > In ND4 and above, a little additional effort would be required to
> > capture the events - onBeforeDisplay, onBeforeHtmlOutput etc. It can
be
> > something like:
> > ==============================================================
> > public class myBaseClass extends CSpPage implements
ISpDisplayListener,
> > ISpHtmlOutputListener {
> > ---
> > ---
> > public int init(){
> > int ret = super.init();
> > addDisplayListener(this);
> > addHtmlOutputListener(this);
> > return ret;
> > }
> >
> > onBeforeDisplayEvent() {
> > --
> > }
> >
> > onBeforeHtmlOutputEvent() {
> > ---
> > }
> > ===================================================
> >
> > Aby
> >
> > -----Original Message-----
> > Sent: Thursday, August 05, 1999 3:09 PM
> >
> > How do I "fake" visual inheritance of pages? I'd like to create a
page
> > with
> > all my controls and error handling code. I want to be able to
inherit
> > from
> > it so that, when I improve the base page, the descendants will
benefit
> > automatically. I guess this isn't available in NetDynamics so I want
to
> > know
> > how to fake it.
> >
> >
________________________________________________________________________
> > _
> >
> > For help in using, subscribing, and unsubscribing to the discussion
> > forums, please go to:
> > http://www.netdynamics.com/support/visitdevfor.html
> >
> > For dire need help, email: [EMAIL PROTECTED]
>
________________________________________________________________________
_
>
> For help in using, subscribing, and unsubscribing to the discussion
> forums, please go to:
http://www.netdynamics.com/support/visitdevfor.html
>
> For dire need help, email: [EMAIL PROTECTED]
>
________________________________________________________________________
_
For help in using, subscribing, and unsubscribing to the discussion
forums, please go to:
http://www.netdynamics.com/support/visitdevfor.html
For dire need help, email: [EMAIL PROTECTED]
_________________________________________________________________________
For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html
For dire need help, email: [EMAIL PROTECTED]