What I want to do is, after a user performs a find/search operation, display the results on a different form: if foundset == 1 use form A (record view) if foundset > 1 use form B (list view)
The problem is that controller.find() does not “pause” method execution and I can’t trigger a methond when the user presses Enter key during a find (or can I?)
r.rios:
What I want to do is, after a user performs a find/search operation, display the results on a different form: if foundset == 1 use form A (record view) if foundset > 1 use form B (list view)
The problem is that controller.find() does not “pause” method execution and I can’t trigger a methond when the user presses Enter key during a find (or can I?)
You CAN control a find.
On the script you run in the “onAction” event of your search - you can do exactly what you want:
On the script you run in the “onAction” event of your search -
Bob Cusick
Huh? which “onAction” event are you refering to?
Desired scenario:
1- user clicks on Select->Find
2- enters find criteria
3- presses Enter or Select->Search
4- if only 1 record go form A / if > 1 record go form B
r.rios:
Huh? which “onAction” event are you refering to?
Desired scenario:
1- user clicks on Select->Find
2- enters find criteria
3- presses Enter or Select->Search
4- if only 1 record go form A / if > 1 record go form B
Servoy is event driven. If you look at the CRM application that comes with the standard install - you’ll see the custom controller form on the left. There is a single field below each section. You can type anything in there, hit the enter (or return key) and it will perform the find. This is done by use of the “onAction” property of the field.
You can also control when the user goes into find mode via the keyboard equivalent (which is what you’re talking about). Hook up your own method to the “onFindCmd” property of the FORM your user is searching on - and you can control what happens when they choose the FIND command from the menu.
OK, we can control when a user ENTERS the find mode.
But what we need here is to trigger a script “onsearch”.
Or am I wrong? In Filemaker we can PAUSE a script ans control what happens after “perform find”. I cannot reproduce this in Servoy at the moment. I can solve this by making for each search criteria a global field and use the technique of the CRM, but this is overkill.
We recieved same request also last week, we will add onSearchCmd to a form after final release of Servoy 2.0 (quite a change to allow scripting in findmode)