Try creating a subclass of CSpButton and implement the processWebEvent():

protected void processWebEvent(CSpWebEvent ev)throws CSpSkipException, CSpStopException
{
  if (ev.getId() == CSpWevEvent.ON_WEB_EVENT)
  {
    // code that executes 
    // before the listeners
  }
  super.processWebEvent(ev);
  if (ev.getId() == CSpWevEvent.ON_WEB_EVENT)
  {
    // code that executes 
    // after the listeners
  }
}

It appears that the event dispatching is done similar to the AWT. 

For the event of type CSpXXXEvent the class that can dispatch that type of event has
         the methods addXXXListener(), removeXXXListener(), processXXXEvent(). The 
class overrides
         the processEvent() like this:

protected processEvent(CSpEvent ev)
{
  if (ev instanceOf CSpXXXEvent) {
    processXXXEvent((CSpXXXEvent)ev);
  }
  else {
    super.processEvent(ev);
  }
}

protected processXXXEvent(CSpXXXEvent ev)
{
  switch (ev.getId()) {
    case MY_EVENT_ID_1:
      _XXXListeners.eventMethod1(ev);
    case MY_EVENT_ID_2:
      _XXXListeners.eventMethod2(ev);
    default:
      // log error ?
  }
}

Beware that events are not dispatched unless they are enabled - there is an event
         mask that prevents events dispatching by type if there are no listeners for 
them.
         So do not expect that processXXXEvent() will be called unless the event is 
enabled
         programatically or there are listeners attached for it in that component.

"Teplitsky, Alexander" <[EMAIL PROTECTED]> wrote:
>Is there a way to extend CSpButton in such a way that it would have some
>code in its onBeforeDisplayEvent executed before
>myButton_onBeforeDisplayEvent of the page to which this button belongs to
>would fire ?

_________________________________________________________________________

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