I have a webblock that is a sidebar. In this webblock we have performance problems and some malfunction and the first thing I have seen is that it goes through the OnParametersChange event more than once. Could someone explain the flow of this event to me?
"Occurs in a Block anytime the parent Screen or Block changes one of its input parameters. Changes to the input value inside the block do not trigger this event handler. You can use it to react to changes in the Block parameters, such as to update variables."
https://success.outsystems.com/Documentation/11_x_platform/Developing_an_Application/Implement_Application_Logic/Screen_and_Block_Lifecycle_Events
it goes through the OnParametersChange event more than once. it means that the input parameter is changing more than once.
Kind regards,
Márcio
So it is the parent that is causing it to load more than once? Is there any way to know which parameter has changed?
It's not because of the parent is because of the input parameter changes on the parent. In this case, it happens because one of the inputs are getting data, and every time the input parameter changes, the event is triggered. Can you show or demonstrate what is happening on the sidebar block?
H all,
a possible scenario is that the inputs of that block, are coming from the data fetches or aggregates on the parent.
As these are asynchronous, each time some part of the information comes back, it will trigger the OnParametersChanged.
Dorine
Oh, as to how to measure this, you could add a console.log at the start of the OnParametersChanged, where you log all the parameter values, maybe that will give you a good idea of what is happening in what sequence.