I have a question related to this thread.
In my app I have two pages: pgA and pgD, and pgA is an ancestor for pgD.
Both pages have code in this_onBeforeDisplay() event, so when I load pgD,
NetDynamics executes code in this event in pgA, then in pgD. Most of the
time it's what I need, but sometimes I only need to execute
pgD.onBeforeDisplayEvent() and not interested in ancestor's script. I am
wondering if there is a way to
sort of "turn it off". If some of you out there are familiar with
PowerBuilder, I am looking for a way to for the descendant to "override"
ancestor script, as oppose to "extend" it.
Thanks -
Alexander Teplitsky
Software Engineer
Pacific Gas & Electric
> ----------
> From: Fred Bruegmann[SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, June 30, 1999 10:20 AM
> To: Troy Mckinnon
> Cc: 'ND'
> Subject: Re: [ND] Overriding an event
>
> You need to add a listener. Below is an example of this from a superclass
> I
> created by extending CSpDataObject.
>
>
> public int init()
> {
> int rc = super.init();
> addDataObjectListener(this);
> return rc;
> }
>
> Hope this helps.
>
> Fred
>
>
> Troy Mckinnon wrote:
>
> > Hey all,
> >
> > I have a question regarding event overriding:
> >
> > I am trying to add some functionality to the onBeforeDisplayEvent of a
> > button.
> >
> > Fin code below:
> >
> > public class testButton extends CSpButton
> >
> > {
> > public int init()
> > {
> > enableEvents (CSpEvent.DISPLAY_EVENT_MASK);
> > return super.init();
> > }
> >
> > protected void processDisplayEvent(CSpDisplayEvent event) throws
> > CSpSkipException , CSpStopException
> > {
> > int command=PROCEED;
> >
> > if (event.getId () == CSpDisplayEvent.ON_BEFORE_DISPLAY_EVENT ) {
> > // I would rather do this with the setVisible(false) method but it won't
> > work here.
> > if(dontShowMe)
> > throw new CSpSkipException ();
> > }
> > super.processDisplayEvent(event);
> > }
> >
> > // Why can't I add actions to the event by including it here in the
> > superclass??
> > // This event does not register at all.
> > public int onBeforeDisplayEvent(CSpDisplayEvent event)
> > throws CSpSkipException , CSpStopException {
> > CSpHtml.sendMessage("<br>---onBeforeDisplayEvent-----");
> > Object src = event.getSource();
> > return myMethod((CSpButton)src);
> > }
> >
> > protected int myMethod(CSpButton bt) throws CSpSkipException
> > if(doIt)
> > {
> > CSpHtml.sendMessage("<br>Security Event<br>");
> > throw new CSpSkipException();
> > }
> > return PROCEED;
> > }
> >
> > }
> >
> > --------------------
> >
> > I would really appreciate any comments or advice...
> >
> > Thanks
> >
> > Troy
> >
> > Troy McKinnon
> > Technical Team Leader
> > Integrated Quality Management System
> > Nortel Networks - GHCT (Dept. 1J11)
> > (613) 765-7685 or ESN (395) 7685
> >
> >
> _________________________________________________________________________
> >
> > 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]
>
>
>
> --
> Fred Bruegmann
> Lead Electronic Commerce Analyst
> Whirlpool Corporation
> Phone: (616) 923-3751
> Fax: (616) 923-4667
> 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]