144
Views
9
Comments
OnChange does not trigger my action

Hello :) 

I am struggling to understand why flipping a switch with a set onchange action does not trigger the action. 

I have also tried with a checkbox and its onchange event, but that did not work either.

I have tried debugging, but it never enters the action at all.

I also checked Service Center for errors, but found none.

Calling the action with an onclick event with a button does work


Has anyone encountered a similar issue and knows how to solve it?


Edit:

I cannot share oml, but will add some pictures of the action and the switch properties

Here is a picture of the action - it is a simple assign to an attribute value of the entity, update the entity and display a message on the screen. 

Here is a picture of the properties of the switch:

The switch held a boolean value attribute from the aggregate the action is updating (e.g. "GetAggregate.List.Current.BooleanValue"). By clicking the switch, this boolean should've changed from false -> true and vise versa, as well as the entity would update. 


2023-03-16 16-29-51
Paulo Rosário

Hello Anders,

Make sure that the OnChange event is pointing to the correct Action and not to another one that can be triggered.


I will attach an oml with a Switch and a Checkbox that triggers a message on the onChange Event so you can take a look. 

hope it helps! 

Paulo Rosário

ForumTestsReactive_OnChange.oml
UserImage.jpg
Anders Stene

Hello

Thank you for your reply, however that is not the issue. The button, checkbox and the switch all call the same action, but it only works through the onclick event of the button

2025-02-10 17-24-13
Arun Rajput

Hi Anders Stene,

Can you please share .oml file because it doesn't matter how many widgets calling same action it should trigger when it's called by any of those widgets.

Thanks,

Arun

2023-03-16 16-29-51
Paulo Rosário

Sorry, I miss understood. 

I ran the same oml but with all the elements pointing to the same action and added a button. 

In my case, it works fine, but it's a simple message. Could it be that you have some custom logic that checks which is the source of the click and does different things accordingly? 

Could you maybe share a screen of the action? 

UserImage.jpg
Anders Stene

Hi, I edited the post now and added a couple of pictures :) 

2022-07-22 08-49-20
Laura Fidalgo

Hi @Anders Stene , were you able to solve the issue?

Can you share an oml or a screenshot? Or, perhaps, do you have logic in you 'OnChange' action that's preventing you from achieving the desired result?

UserImage.jpg
Anders Stene

Hi, I edited the post now and added a couple of pictures :) 

2023-10-21 19-42-11
Tousif Khan
Champion

Hello

Can you add a message to your flow to check whether it is working fine or not,
And it is only happening on a On change action, except your debugger is working fine?

Thanks

UserImage.jpg
Anders Stene

Hello

As stated, it never enters the action when it is called through an onchange event of the switch. 

The debugger is probably not the issue, as it stops on breakpoints in other actions and breakpoints in the action in question when called through onclick with a button.

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