cancel
Showing results for 
Search instead for 
Did you mean: 

How can I unsubscribe an event?

Former Member
0 Kudos

Hi all,

I subscribe an iView to an event and it catch the raise of the event.

The problem is that the method associated to the event is executed more than once time. It looks every time I subscribe the event, although it's the same event, it adds the event again and again although it's already added.

I have thought to unsubscribe the event when I catch the raise.

Is it possible to unsubscribe the event?

Regards,

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos
Former Member
0 Kudos

Hi,

Thank you GLM but I'm not using WebDynpro.

I have download epcf.js and I have seen the event unsubscribeEvent.


var id_event = top.EPCM.subscribeEvent('urn', 'MyEvent', MyMethod);
...
top.EPCM.unsubscribeEvent('urn', 'MyEvent', id_event);

It works, but I have had to close and reopen the browser, because EPCM was cached.

Thank you all,

Regards,

Former Member
0 Kudos

It was a cache problem. I modified the code unsubscribing the event, but it looked EPCM was cached and didn't take the neew code.

Thank you all.

Answers (0)