Curt,
Thanks for the idea. Instantiating an ISpDiplayListener on-the-fly is
something new to me.
I guess I am safe with my old code if I am only interested in the page's
events and leave the fileds to their natural destiny. (I try to avoid
anonymous inner classes since they create an extra classfile with a $ in
the name).
Aby
-----Original Message-----
From: Curt Springer [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 05, 1999 5:23 PM
To: Aby Mathew
Cc: 'Teplitsky, Alexander'; 'NetDynamics Developers forum'
Subject: Re: [ND] Visual Inheritance possible ?
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
>
_________________________________________________________________________
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]