Hi,

Just from a cursory look at your code, it seems that you are not registering
the listener until after the onBeforeInitEvent() has already been called --
this explains why it isn't called.  You might try registering the listener
in the constructor.

[EMAIL PROTECTED]
Team NetDynamics

> -----Original Message-----
> From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
> Sent: Friday, May 07, 1999 2:59 PM
> To:   [EMAIL PROTECTED]
> Subject:      [ND] onBeforeInitEvent not firing for custom page class
> 
> Does anyone understand why the onBeforeInitEvent() would not fire
> when the listener has been implemented?
> 
> When implementing ISpInitListener, one must implement both the 
> onBeforeInitEvent() and onAfterinitEvent().  For me, the 
> onAfterInit event fires, but not the onBeforeInitEvent().
> Unfortunately, my code needs to go in the OnBeforeInitEvent() and not the
> OnAfterInitEvent.
> 
> Some sample code follows:
> 
> 
> package Inherit;
> 
> import java.awt.event.*;
> import java.util.*;
> import spider.event.*;
> import spider.database.*;
> import spider.visual.*;
> import spider.*; 
> import spider.session.*;
> import spider.html.*;
> import spider.util.*;
> 
>  
> //[[SPIDER_CLASS BEGIN
> public class MyPage extends spider.visual.CSpPage
> implements spider.event.ISpInitListener,
> spider.event.ISpDisplayListener,
> spider.event.ISpHtmlOutputListener
> {
> 
>       /**
>        * Constructor 
>        */
>       public MyPage()
>       {
>               super();
>       }
>       
>       
>       /**
>        * Initialize object and register listeners. 
>        */
>       public int init()
>       {
>               super.init();
>               addInitListener(this);
>               addDisplayListener(this);
>               addHtmlOutputListener(this);
>               
>               return (PROCEED);
>       }
>       
> 
>       public int onBeforeDisplayEvent(CSpDisplayEvent event)
>       {
>               return (PROCEED);
>       }
>       
> 
>       public int onBeforeHtmlOutputEvent(CSpHtmlOutputEvent   event)
>       {
>       CSpLog.send(this, CSpLog.CRITICAL,  "*****Entering My Event*****"); 
>               return (PROCEED);
>       }
> 
>       
>       public int onBeforeInitEvent(CSpInitEvent event)
>       {
>               CSpLog.send(this, CSpLog.CRITICAL, "*****Entering
> OnBeforeInit Event*****"); 
>               return (PROCEED);
>       }
> 
> 
>       public int onAfterInitEvent(CSpInitEvent event)
>       {
>                               return (PROCEED);
>       }
> 
> 
> }
> 
> _________________________________________________________________________
> 
> 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]

Reply via email to