I need to trigger a method after Servoy generates a search result list.
In FMP I would script a find and after the “Perform Find” statement trigger another script.
I tried to do this but nothing seems to run AFTER the find command.
I tried to trigger this script based on onShow but onShow does not seem to trigger after you do a find (I assume because you are already on the form).
Any suggestions on this? I need this method to trigger any time the form is shown as the script updates information based onthe number of found records. When something occurs that could change this I need to run my update script.
If you do the find/search in a method you can just attach another method in the find method or add the scripting to your find mehtod.
If you let the user do the find/search there is no event or other way to accomplish this.
Just not available yet but Servoy promised us something in the near future although I don’t think this is easy for them because this is quite a long time ago…
I have a find method which does a currentcontroller.find() and I tried to trigger my update method after it, but it does not seem to run.
The script waits for user input (currentcontroller.find()) and once they hit enter nothing else happens.
I believe this is what you were describing, or are you suggesting I make a form to accept find requests and run it through a method that does a:
find();
set elements to user input
search();
run update method
??..or something else?
Ah, no I think I didn’t make myself clear enough but your answer will get us there
The script waits for user input (currentcontroller.find()) and once they hit enter nothing else happens.
This way the answer to your question is: it won’t work. Not possible ‘yet’
believe this is what you were describing, or are you suggesting I make a form to accept find requests and run it through a method that does a:
find();
set elements to user input
search();
run update method
??..or something else?
No, this was not what I was describing but it is the answer for the issue. Create a ‘find.form’, capture the values the user want to search for and run a method with those values:
controller.find();
a = input.a
b = input.b
etc.
controller.search();
run the method you want to be run...
Hope this helps.
Just for clarification, can I run other methods AFTER the search() command, based on your method? or once you say search() the script is done executing?