134
Views
5
Comments
OnparametersChange reloads more than once
Application Type
Reactive

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?

2021-06-02 20-50-04
Márcio Carvalho

"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

UserImage.jpg
CrisSanz

So it is the parent that is causing it to load more than once? Is there any way to know which parameter has changed?

2021-06-02 20-50-04
Márcio Carvalho

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?

2021-09-06 15-09-53
Dorine Boudry
 
MVP

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

2021-09-06 15-09-53
Dorine Boudry
 
MVP

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.

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