568
Views
8
Comments
OnParameterChanged getting triggered even if block input parameters are not changed
Question

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.

mvp_badge
MVP

Hi Nikhil,

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

mvp_badge
MVP

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.

mvp_badge
MVP

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.

mvp_badge
MVP

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.

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.

aaaa.oap

Hi all, 

This topics was opened 2 years ago but I'm currently facing the same issue, and I don't know if the problem is still opened or if we can have a workaround anywhere? Should I open my own topic?

Just in case, my issue is related to a block with parameters. On my page, when I click on button, variables/actions are processed/updated, but the input parameters of the block are not updated at all. Nevertheless, the OnChangeParameter event of the block is triggered (twice), with each time the same inputs.

If you have any suggestion :)

Thank you 

Julien

Hi, I'm glad I found this topic to see others have reported the issue before.

11 March 2022, we still have the same issue in our project, without any change of value to the input parameters (debug confirmed), the OnParametersChanged of the block keeps running infinitely.

Has anyone of the previous commenters been able to isolate what triggers the issue? I cannot reproduce the same issue in a small oml. It must be something related to our project, but I cannot isolate the cause...

I thougt it might happen because we used a function directly as an input parameter, but changing it to a local variable does not solve the issue. Even when I hard code every input value, the issue remains. That's when I started searching for bug reports... :-)

Anyway, I subscribed to this post, and here's our version info.




edit : I have found a cause to the issue! One input parameter is a static entity identifier (Entities.SecurityRight.CanViewReservations). I considered this hardcoded to "8". But when changing this value to NullIdentifier() the infinite loop issue does not occur. So this seems to be the root cause of the issue for our project.

when this value is as it is in the snip above, which corresponds simply to id 8, our application will show this information below. I decided to put some debug information on screen, because I was really not understanding it.

I have highlighted the input variable values to indicate they are unchanged each time OnParametersChanged runs.

When SecurityRightId is NullIdentifier(), the infinite loop is gone. Anyone has an explanationand/or a way to fix this or work around?



I have a similar issue. I have three containers with blocks inside of them. Each block uses the same Input parameter. The input is selected in a parent screen. Based on the logic, the visibility of the containers changes when the Boolean variable value changes for that container. Simply saying, when I click "Back" button to hide current container and to make another container visible, it reloads data in a container that has become visible. Even though the input parameter has not changed. It would be ok, if it was just to display data. But when you have selection in a data grid, and you want to preserve that selection, so that user could add or remove items, it's crucial. 

I use version 11.14.7

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