Define webblocks event run order in a screen
85
Views
5
Comments
New
Frontend (App Interfaces)

The idea is simple, so we can define events in a webblock and the idea is that when we put the webblock in a screen we need to assign some action to those events and the idea is have the possibility of define the order that those events should run when the screen is rendered.


Regards 

Miguel Grilo

Why do you need this?

Example can be that i have two events and one the events depends on the other one if i can decide wich one runs first i can do that logic

Hi, @Miguel Grilo Are you asking idea, or question? and what is the use for this 

I've explain in the previous comment an example of use. 

It's an idea to have the hability to choose the running order in events from a webblock.


Regards

are you talking about custom events a webblock might raise, and the parent of that webblock can attach a handler for ?  In that case, there is no such thing as an order, they just get handled in the order they are fired.  And it is the block's code firing them, so you have to orchestrate there if there is dependence.

You still didn't give a real example, just a generic "one the events depends on the other one", that doens't help us understand what you are talking about.

But you are also talking about "when the screen is rendered", so that suggests that you don't mean custom events, but the standard block lifecycle events ??? In that case, there is a defined order in which block and screen events are happening, and you just have to understand what that exactly is, and adjust your code to make good use of that.