OnParametersChanged Triggers

Hi guys,

I noticed a behavior with on the OnParametersChanged event that I was not expecting.

I have a Block that has a parameter of a structure type with two text values.
If I pass it as a parameter a local variable of that type it triggers the events as expected.
If I pass that parameter directly in the block by expanding the structure value, the OnParametersChanged is triggered even when other variables totally not related are changed and they are on the screen. 

If it was not very clear here is a link with a demo. Check the console log for the log of the events. I have also attached the Oml.
https://goncaloneto.outsystemscloud.com/ReactTestApp/TestScreen?_ts=637241416214989929

Is this expected behavior or a bug ?

Hello Pedro.

Your oml is not a working example.
You weren't setting the structure OnChange and you were using strings instead of variables in one of the cases.

Please see if this example still matches your test scenario.


With your module fixed, I got two identical notifications (see number 2 on the right). 


I can have two different notifications if I set another input with a string to name the block and JS to print that name.

Was this distraction on your end, or am I doing something that fixes the error without noticing?

Nuno Reis wrote:

Hello Pedro.

Your oml is not a working example.
You weren't setting the structure OnChange and you were using strings instead of variables in one of the cases.

Please see if this example still matches your test scenario.


With your module fixed, I got two identical notifications (see number 2 on the right). 


I can have two different notifications if I set another input with a string to name the block and JS to print that name.

Was this distraction on your end, or am I doing something that fixes the error without noticing?

Hi Nuno, 

Thanks for your attention. 

You changed the blocks to receive the parameters from the input change. That triggers the on parameters changed event and is expected. 

In my scenario I am trying to show that the on parameters changed event is called even when i change nothing on the parameters of the block if i assigned strings directly. I understand it may not be best practice, because they are hardcoded values, but why is it triggering the event only on that situation? 


Ok, the first time I saw it, it made no sense. I was reading the exact opposite "webblock is not receiving new values".

Yes, it seems the webblock refreshes all the time. This even simpler example does it all the time and there is no connection.

Exactly, seems like a bug right? 

Edit: of course this example doesn’t make sense, cause it is so simple and is trying to show the scenario only, but on a real application there will be parts of the screen being refreshed that will not affect all blocks, but it may be triggering their onParametersChanged event. 

Hi Pedro,

The OnParametersChanged event is triggered every time a parameter changes. To speed up this check and have performant apps, it is not done a deep equality of the new and previous value, it is instead done a comparison of the object references. When you use the variable you are sending the same object to the block, so the reference is the same and the event does not trigger. When you are expanding the input structure you are creating a new structure every time you render the block, so the references will be different and the event will trigger.