Reactive: OnParametersChanged per Input parameter
320
Views
4
Comments
New
Frontend (App Interfaces)

I want to be able to have different onparameterschanged, depending on which inputparameter has changed.


Now i have to create duplicate variables to check which inputparameter has changed.

I voted for it, but alternatively one could consider to have two scoped variables available in the event handler "ChangedParameter", "ChangedParameterValue".


Thank you for the vote. You are right: there are more possible solutions to fit the need.


As long as i can determine without much trouble which inputparam changed i am happy with the solution.


My usecase that made me consider posting this idea is that i have a webblock with 2 inputparams: 1 for data and 1 to determine if the webblock can be edited. when my data has changed i want the webblock to do other things than when the AllowEdit flag has changed.


My fix was to save the data structure and with each OnParamsChanged i have to check if both are the same or not. This can get get complex if you have more inputparams.



Changed the category to
Frontend

Hi Stefano,

see my third reply in this post for a possible way to 'fake' multiple OnParametersChanged with the use of a helper webblock.

Dorine

This would simplify web block development as we wouldn't need to do all of the workarounds mentioned. It would reduce the number of variables required and would also increase performance (albeit by not much) as the OnParametersChanged would not be required to have so much logic to know what changed etc.

I seriously think OutSystems should consider this enhancement.