Form onDataChange called twice

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

Form onDataChange called twice

Postby roddy » Tue Aug 10, 2021 3:04 am

When a form has a onDataChange() action; if the data source field is changed in this function, then it calls the onDataChange() again. I have tried looking at the JSEvent, old and new values but I cannot figure out a way to determine if the call is from the form itself; it could also lead to an infinite loop. The data source is a form variable.

When the second automatic call is made, the datasource still has the original newValue from the first call.

It really shouldn't be triggering a form action event from the form again. Is there anyway of stopping the second onDataChange() call (or establishing that it is a second call)?

Posts: 83
Joined: Mon Oct 26, 2020 12:32 am

Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 8 guests