After having spent numerous hours on a stupid simple problem I give up searching for a solution or explanation… Hopefully, someone can shed some light into the matter.
I have five global methods for searching, which are attached to buttons that I place on most forms.
1: find - controller goes into find mode, the button is disabled and the following 4 buttons are set to visible, the current foundset is stored
2: search
3: reduce search
4: extend search
5: cancel search
2-5 set the buttons 2 to 5 to invisible, perform the search or cancel the search with recovering the foundset.
1-4 work fine, but 5 just does not work. The global method is not even called - debug not possible. All buttons are located in a tabpanel, which also contains the form that I use to do the search. The main controller has the same foundset. When I attach the cancel method to a label in a different tabpanel (in the top navigation panel) it works fine.
I noticed that when in find mode, the Methods-menu is greyed out. It seems like most methods cannot be called in this mode. Why do buttons 2 to 4 work? Why does 5 work when called from a different panel?
Hope I managed to descibe the situation well enough. Somehow, I’m convinced that the cancel button used to work, when I started designing the solution, but I’m not 100% sure.
We are still scratching our heads why a ‘hack’ has to be implemented to accomplish something that should be supported formally? Will this ‘hack’ always be supported? What if Servoy decides to close this back door? It would be much more elegant to just support it with foundeset.isInFind() and give the developer control.
All we need is for this to ‘hack’ to become unsupported and a 1,000 clients ‘find’ doesn’t work anymore.
This ‘hack’ was implemented by Servoy themselfs so you can expect them to support it .
Before this ‘hack’ no methods ever ran in findmode.
I suggest you file a feature request to make it work differently.
We don’t mind the ‘hack’ just apply it fairly. In 5.0 you don’t even need the ‘hack’ for methods to fire on buttons and labels, but they forgot to include dataprovider elements it seems. We have filed a case and made a business case for the change.