120
Views
1
Comments
How to pass screen action from parent to a child block?
Question
Application Type
Reactive

Is there a way to pass screen action from parent to a web block? 

The reason being is, I want to log start and end time of buttons' screen actions. Im thinking of passing the button id and the screen action to the child block, then I would be modifying the onclick of the button using javascript to be: 

Log time -> Screen action -> Log time. 

I will be using this to a lot of buttons on different screen so I like to make it reusable, and would like to avoid adding the logging logic to the screen actions itself. This is just PoC and I dont even know if its possible.

Or if theres another way to do this please let me know. thanks

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Ars,

I'm not entirely sure what you mean here, but that's definitely not the OutSystems way of doing things. A block typically contains some data you want to show on screen, and maybe also fetch it inside the block. Blocks aren't used to modify things that are passed to them. In fact, Blocks do not have any output, only input. They can trigger the parent screen or block by way of Events, which is the way to signal there's been some event that needs handling.

tl;dr No, what you seem to want cannot be done this way, and is also not the way OutSystems works.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.