OnParameterChanged getting triggered even if block input parameters are not changed

I am getting this issue in below scenario:

  • I am using reactive web app
  • I have created a block with some input parameters and also defined its OnParameterChanged event
  • An event is also added on block to send value to parent screen
  • In parent screen I have added the block & passed hard coded value (not using any local or input variable) and also defined event handler for the block's event
  • In block event handler I am getting input value (text type) and adding it to a text list local variable on screen
  • On my screen I have a list widget and its source is set to the same text list created in block's event handler

Now the problem is every time block event is called it also triggers the OnParameterChanged even if all even parameters passed are hardcoded and not using any screen variable.

If I either ListAppend node from block even handler or I use different list as list widget source then OnParameterChanged doesn't trigger. So I can't use same list for both (list append & list widget source) at the same time.

Hi Nikhil,

Can you share a (minimal) OML that shows this behaviour? It's a bit difficult to "debug" without the source.

Hello Nikhil,

This is not the expected behaviour. On Parameters Changed should be called ONLY if the value associated with at least one of the Input Parameters of a block changes.

If this spurious trigger is happening, this is probably a bug.

First, check if everything is up to date in your environment (OutSystems UI, etc).

Then, create a small app that can reproduce this behaviour, and after verifying that this behaviour indeed happens consistently, use the Help->Give Us Feedback menu in Service Studio to clarify what is happening, saying that it is probably a bug, and send this feedback with your OML to OutSystems, so that they can take a look and confirming the bug, to implement a solution.

If one of the input parameters using a variable as the value source can halt this behaviour, you can do a small workaround using a dummy input parameter. At least until this is worked out. 

Cheers.

Hi Kilian & Eduardo,

Thanks for your suggestions. I will prepare a minimal OML to reproduce the same issue and will share shortly. Also as said I will share with OutSystems support if this is found to be a bug in OutSystems itself.

I tried to prepare the minimal oml but there was no such issue in it. Looks like there are some more factors involved which I will check and update here.

Processing Upload...

Hi Nikhil,

I am curious as to how you went.  I am seeing the same issue myself.

I have been able to reproduce it with this app (creatively named 'aaaa', attached).  I will log a bug with OutSystems support.

It happens when I have an input type to the block that is a structure and I expand the structure to enter values, instead of specifying a local variable.

Then when I update another local variable (GetMyEntityById.List.Current.MyEntity.Name) to a different value, the block will trigger a component update that triggers OnParametersChanged().  The local variable that is being updated is not used by the block's input parameters.

It looks like the expanded structure attribute is triggering the change, at a guess, maybe the structure is being recreated each time.