Hello all:

You can definitely do this; we've done it on 2 separate projects now.

Put all your visual controls in the superpage and define this_onBeforeInitEvent
in the superpage
to be final and go through and add all the visual controls using the ND
addChildren() method.  (You
can call out to your own method beforeInit() if you need your subpages to be
able to do things in
their init events also.)

In reality, now every subpage will contain the display fields that are on the
superpage, but they
will be suppressed unless the **VisualName** is embedded in the subpage's HTML.

If you're talking about a button, you have to be careful -- events will be
delivered to every page
containing the button that has been instantiated in the current project graph.
For the first project
graph in a CP worker, this will be every page containing the button; for
subsequent ones, it will
be an arbitrary subset.

When rolling your own event code, you have to be careful to make sure to ignore
the event if it
didn't come from your own page -- you can check for this by using the PATH_INFO
HTTP
variable.

I can provide more details as necessary, but we haven't seen any problems with
it thus far.

-- David.


                                                                  
 (Embedded                                                        
 image moved   [EMAIL PROTECTED]                          
 to file:      08/05/99 07:10 PM                                  
 pic17393.pcx)                                                    
                                                                  



To:   [EMAIL PROTECTED]
cc:    (bcc: David P Caldwell/GL/KSC/KeyCorp)
Subject:  Re: [ND] Visual Inheritance possible ?







Just curious, can he also put the visual controls on his myBasePageClass ?

Or is that getting too tricky for ND4? Any limitations to be aware of?

Thanks,
Janet





 (Embedded
 image moved   Aby Mathew <[EMAIL PROTECTED]>
 to file:      08/05/99 07:03 PM
 pic31697.pcx)




To:   "'Teplitsky, Alexander'" <[EMAIL PROTECTED]>, 'NetDynamics Developers forum'
      <[EMAIL PROTECTED]>
cc:    (bcc: Janet Traub/IS/SSC/THD)
Subject:  Re: [ND] Visual Inheritance possible ?




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-----
From: Teplitsky, Alexander [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 05, 1999 3:09 PM
To: 'NetDynamics Developers forum'
Subject: [ND] Visual Inheritance possible ?


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]



pic31697.pcx

pic17393.pcx

Reply via email to