Because onBeforeDisplayEvent and onBeforeHTMLOutputEvent can be defined for
multiple fields on one page, there could be a conflict if the page itself
is the listener. You might want to look into using anonymous inner classes:
public class myBaseClass extends CSpPage {
---
---
public int init(){
int ret = super.init();
CSpDisplayField field1 = getDisplayField("*field1");
field1.addDisplayListener(new ISpDisplayListener()
{
public int
onBeforeDisplayEvent(CSpDisplayEvent event)
{
//whatever
}
}
);
CSpDisplayField field2 = getDisplayField("*field2");
field2.addHtmlOutputListener(new ISpHtmlOutputListener()
{
public int
onBeforeHtmlOutputEvent(CSpHtmlOutputEvent event)
{
//whatever
}
}
);
return ret;
}
}
-- Curt Springer, Team ND
At 04:03 PM 8/5/99 -0700, 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-----
>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]
_________________________________________________________________________
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]