# onDataChange triggers on Find...

**URL:** https://forum.servoy.com/t/ondatachange-triggers-on-find/3170
**Category:** Classic Servoy
**Created:** [November 30, 2004, 6:07pm UTC](https://forum.servoy.com/t/ondatachange-triggers-on-find/3170 "2004-11-30T18:07:22Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![Cain](https://avatars.discourse-cdn.com/v4/letter/c/85e7bf/32.png) [@Cain](https://forum.servoy.com/u/Cain)
#### Post date: [November 30, 2004, 6:07pm UTC](https://forum.servoy.com/t/ondatachange-triggers-on-find/3170/1 "2004-11-30T18:07:22Z")

</div>

Can anyone else reproduce this?

I have a table. One of the fields, not in the tab order, has an ‘onDataChange’ method. No other fields on the form have onDataChange methods.

When I enter Ctrl + F (no onFindCmd method, just default), the onDataChange method runs.

onDataChange runs if I’ve clicksorted on a related field (see other thread) and omitted some records, then hit Ctrl + J to find all again.

The data doesn’t seem to change in that field, so I can’t figure out why it’s triggering.

---

<div class="post-metadata">

### Author: ![Harry\_Catharell](https://avatars.discourse-cdn.com/v4/letter/h/e19adc/32.png) [@Harry\_Catharell](https://forum.servoy.com/u/Harry_Catharell)
#### Post date: [November 30, 2004, 8:13pm UTC](https://forum.servoy.com/t/ondatachange-triggers-on-find/3170/2 "2004-11-30T20:13:57Z")

</div>

Hi Cain,

Can you post version information, too, so that we can verify or deny like for like !?

Thanks  
Harry

---

<div class="post-metadata">

### Author: ![Cain](https://avatars.discourse-cdn.com/v4/letter/c/85e7bf/32.png) [@Cain](https://forum.servoy.com/u/Cain)
#### Post date: [November 30, 2004, 8:25pm UTC](https://forum.servoy.com/t/ondatachange-triggers-on-find/3170/3 "2004-11-30T20:25:57Z")

</div>

Sure.

Microsoft Windows 2000 5.00.2195 Service Pack 4  
Servoy Developer Version R2 2.1.1-build 313  
Java version 1.4.1\_02-b06 (Windows 2000)  
Adaptive Server Anywhere 9, version 9.0.1.1751  
Sybase Central 4.3.0.2184

---

<div class="post-metadata">

### Author: ![Harry\_Catharell](https://avatars.discourse-cdn.com/v4/letter/h/e19adc/32.png) [@Harry\_Catharell](https://forum.servoy.com/u/Harry_Catharell)
#### Post date: [November 30, 2004, 10:15pm UTC](https://forum.servoy.com/t/ondatachange-triggers-on-find/3170/4 "2004-11-30T22:15:56Z")

</div>

Hi Cain,

Servoy Developer  
Version R2 2.1.2-build 315  
Java version 1.4.2-38 (Mac OS X)  
SyBase ASA

Created a new form using the example data database and the customers table and omitted a field from the tab order.

Added the onDataChange method to it which showed a formInDialog.

The method fired correctly when data was changed but I could not reproduce the effect that you get when moving to Find !

Can you reproduce this effect if you create a new form to test it ?

Cheers  
Harry

---

<div class="post-metadata">

### Author: ![Cain](https://avatars.discourse-cdn.com/v4/letter/c/85e7bf/32.png) [@Cain](https://forum.servoy.com/u/Cain)
#### Post date: [November 30, 2004, 11:07pm UTC](https://forum.servoy.com/t/ondatachange-triggers-on-find/3170/5 "2004-11-30T23:07:13Z")

</div>

OK, that helped focus me a bit. ![:wink:]( "Wink")

At first, I couldn’t reproduce it, even when I set all the form and element triggers the same… then I used a field as a checkbox, with a calculation, and off it went!

The checkbox field with the onDataChange trigger is called ‘flag\_selected’ and is calculated as follows:

```auto
if ( utils.stringPatternCount ( '|'+ globals.selectNewString +'|', '|' + pk + '|' ) > 0)
{
	return 1;
}

```

I’ve found that I can reproduce this with other calculated fields as well, though.

Can you reproduce this with the additional information? If so, whaddaya think? Bug or just developer misunderstanding? ![:?]( "Confused") onDataChange seems to be triggering on field evaluation, not just when it changes. Is that expected? Am I seeing this right?

---

<div class="post-metadata">

### Author: ![Harry\_Catharell](https://avatars.discourse-cdn.com/v4/letter/h/e19adc/32.png) [@Harry\_Catharell](https://forum.servoy.com/u/Harry_Catharell)
#### Post date: [December 2, 2004, 2:07pm UTC](https://forum.servoy.com/t/ondatachange-triggers-on-find/3170/6 "2004-12-02T14:07:01Z")

</div>

Hi Cain,

Version R2 2.1.2-build 315  
Java version 1.4.2-38 (Mac OS X)  
SyBase ASA

I have tried but cannot reproduce this behaviour !

I even set up both stored and unstored calculated columns.

Can you create a solution which demonstrates it and post it to assess ?

You know that we are the same people divided by language and it just may be that I am misinterpreting the conditions under which it causes the problem for you ![:-)]( "Smile")

Cheers  
Harry

---

<div class="post-metadata">

### Author: ![Harry\_Catharell](https://avatars.discourse-cdn.com/v4/letter/h/e19adc/32.png) [@Harry\_Catharell](https://forum.servoy.com/u/Harry_Catharell)
#### Post date: [December 2, 2004, 2:21pm UTC](https://forum.servoy.com/t/ondatachange-triggers-on-find/3170/7 "2004-12-02T14:21:46Z")

</div>

Hi Cain,

> Harry Catharell:  
> You know that we are the same people divided by language

You realise of course that I meant to paraphrase this :  
“You know that we are different people divided by the same language”

javascript:emoticon(‘😉’)

Fingers, don’t fail me now !

Harry !!

---

<div class="post-metadata">

### Author: ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)
#### Post date: [December 2, 2004, 6:06pm UTC](https://forum.servoy.com/t/ondatachange-triggers-on-find/3170/8 "2004-12-02T18:06:09Z")

</div>

can you post this behaviour in a sample solution?

---

<div class="post-metadata">

### Author: ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)
#### Post date: [December 3, 2004, 2:08pm UTC](https://forum.servoy.com/t/ondatachange-triggers-on-find/3170/9 "2004-12-03T14:08:23Z")

</div>

thx for the sample solution  
fix it for the next release (2.2)

---

<div class="post-metadata">

### Author: ![Harry\_Catharell](https://avatars.discourse-cdn.com/v4/letter/h/e19adc/32.png) [@Harry\_Catharell](https://forum.servoy.com/u/Harry_Catharell)
#### Post date: [December 3, 2004, 2:46pm UTC](https://forum.servoy.com/t/ondatachange-triggers-on-find/3170/10 "2004-12-03T14:46:50Z")

</div>

This post may need to move to Forum Support, but did the sample solution get sent as an attachment ?

I can’t see it if it did so is this a setting problem with my profile ?

Harry

---

<div class="post-metadata">

### Author: ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)
#### Post date: [December 3, 2004, 4:12pm UTC](https://forum.servoy.com/t/ondatachange-triggers-on-find/3170/11 "2004-12-03T16:12:59Z")

</div>

no there is a problem with attachements currently  
is being worked on  
(the solution got send through personal mail)

---

<div class="post-metadata">

### Author: ![antonio](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@antonio](https://forum.servoy.com/u/antonio)
#### Post date: [March 13, 2007, 5:29am UTC](https://forum.servoy.com/t/ondatachange-triggers-on-find/3170/12 "2007-03-13T05:29:51Z")

</div>

In Servoy 3.1.3 I’m seeing similar behaviour, in developer. If I move to a form with

```auto
forms.invoices.controller.showRecords(foundset)

```

it triggers the onDataChange method of a field in the invoices form. There’s nothing else that calls that method.  
It’s a plain text field, with a value list.

oh — it doesn’t trigger every time. Don’t you hate intermittent things. Any suggestions on where to go hunting?

---

<div class="post-metadata">

### Author: ![rgansevles](https://avatars.discourse-cdn.com/v4/letter/r/3d9bf3/32.png) [@rgansevles](https://forum.servoy.com/u/rgansevles)
#### Post date: [March 14, 2007, 8:06am UTC](https://forum.servoy.com/t/ondatachange-triggers-on-find/3170/13 "2007-03-14T08:06:03Z")

</div>

Tony,

Can you reproduce it in a small sample solution?  
I tried one, but couldn’t reproduce.

Rob

---

<div class="post-metadata">

### Author: ![antonio](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@antonio](https://forum.servoy.com/u/antonio)
#### Post date: [March 14, 2007, 9:15am UTC](https://forum.servoy.com/t/ondatachange-triggers-on-find/3170/14 "2007-03-14T09:15:28Z")

</div>

Thanks Rob, I’ll give it a try - the hard bit is it’s intermittent
