[Event System] OS10 event still triggered even though it shouldn't.

[Event System] OS10 event still triggered even though it shouldn't.

  
Forge Component
(30)
Published on 15 Jan by leonardo.fernandes
30 votes
Published on 15 Jan by leonardo.fernandes

I'm working in OS 10 and I got multiple webblocks with Event Handlers in them.

Now I'm throwing an event on all these blocks however some of them are hidden in IF branches.

I have noticed that once I've loaded/shown a block once, it will suddenly catch all events thrown, even after I hide it in the IF branch.

I am able to counter this by checking if the block should even do something when it catches the event, but this is causing so much more work.

Hello Claring.

Are you using the .NET version? I am aware of this issue, but just haven't had time to fix it. But I'll need to fix it, because I'm running into the same problem in a project.

I'll try to fix it during the weekend, and I'll let you know.

Hey Leonardo, 


Exactly, I'm using the .NET version.

Thanks, I'm looking forward to it!

Claring, could you share some portion of your application that exhibits this behaviour? I'm not having difficulty reproducing, but it would be good to have a real-world use case for having events inside ifs. And I would be able to test it in the same exact conditions as you are using.

Leonardo,


I have sent you the file in a PM.

Solution

Claring, just to let you know that it took me a while, but I've finally fixed the issue. Starting with Event System 10.0.6, the events are no longer triggered if they weren't rendered in the first place.

Solution