'find' method makes the first field active *after* search

I have a very simple ‘find’ method being used for a button:

controller.find();
session_date = ‘today’;
controller.search();

When I run it, Servoy performs the find as expected, but then immediately activates the first field on my form like I clicked on it to edit it - and indeed it goes into edit mode with the ‘e’ at the bottom. The first field in question also happens to be a value list, so it’s even more annoying that it drops down and gives even greater potential for people to screw up the record.

Why is it doing this?

Normally when I hit Control-F to enter find mode, it selects the first field automatically like this. Near as I can tell, it seems like it’s doing the same thing as a result of my controller.find() call, but it’s doing so lagging behind the fact that the search was already performed… like a delayed reaction.

Servoy 3.5.3

I thought this might be another JRE 1.6-ism, but I tried today under 1.5.0 and it behaves exactly the same. :frowning:

i don’t think this is the default servoy behavior.

however, the form’s onRecordSelection() event fires after a controller.search() – whether manual or in a method. do you have a method attached to this event that is doing something?

I filed a bug and was told to enclose my search code in an if() of the find() function to trap times when going into find mode might fail, but that didn’t solve my problem (I and I’d originally had it that way first using an example out of one of the dev guides.)

Well, tonight I updated to 3.5.4 and my problem seems to have mostly gone away, though I don’t necessarily see any fixes in the 3.5.4 release notes that seem to apply… but who knows. Anyways when I launch my method I don’t get stuck into the first field anymore, but I DO still wind up in ‘edit’ mode (with the little ‘e’ at the bottom of the window) as if something has changed.

I need to watch the server when hitting ‘save data’ and see what it thinks has changed but at least it’s not activating fields in my form anymore.