onDataChange triggers on Find...

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.

Hi Cain,

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

Thanks
Harry

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

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

OK, that helped focus me a bit. :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:

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? :? onDataChange seems to be triggering on field evaluation, not just when it changes. Is that expected? Am I seeing this right?

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 :-)

Cheers
Harry

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(‘:wink:’)

Fingers, don’t fail me now !

Harry !!

can you post this behaviour in a sample solution?

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

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

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

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

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?

Tony,

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

Rob

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