Since there is no FMP equivalent of the above function, how would I set the visability of text in a global or preferrably the global itself when I change modes?
Can you please explain what you are trying to archieve?
I want to place a global.searchField on top of a dataprovider linked to a related table. When Servoy is in find mode, I want the global.searchField to show, when it is in Ready mode I want it (global.searchField) to disappear.
I’m basically trying to mimic the functionality of the RapidCoolSearch Technique without using a controller on the side. The search fields will be globals that are placed over the regular Ready fields and will be “invisible” once they perform their function of grabbing the data.
ok, what you can do is give the element (that you show the global value in ) a name.
After you named the element you will see the elements name appear (possibly after a refresh) in your method editor. Now all properties of the element are scriptable. One of the properties is ‘elements.name.visible’ that you can set true or false.
I’m sorry for not being clear, the above I understand, what I don’t know is how to tell what mode I’m currently in, Ready or Find?
Providence1:
I’m sorry for not being clear, the above I understand, what I don’t know is how to tell what mode I’m currently in, Ready or Find?
When you use the controller.find instruction, you’re in Find Mode; using controller.search you perform the search, so you normally exit Find Mode (unless the foundset is 0).
Just make your global visible right after controller.find and hide it again when you finish the search.
I have a similar circumstance. I’m actually setting a value for the background color when going to and from find. Also, other functions should behave differently in find. F’rinstance, deleting in find doesn’t require any verification. New in find mode doesn’t require the user to have access to add records…
So long as the user does a find, ‘saves’ the find and gets the result they want, I can set a flag during onFindCmd and onSave.
What’s got me going in circles is, what do I do when the user enters a value they can’t find, and Servoy says, ‘no results, try again’? onSave has already occurred, but no other method has triggered to set the flag back to ‘find mode’.
I know I could do this the old FMP way, with a separate find layout and a bunch of globals. I’m trying to leverage Servoy’s existing functions, though. If the answer is that I just need to disable Servoy’s native find functions, so be it, but I suspect that I’m just missing something here.
so you have an script attache to onFindCmd
where you set a flag and then call find()
then you use onRecordSave() ? That one shouldn’t trigger (scripts are disabled in search)
We don’t have an onSearchCmd at this time. this is in the planning.
If methods didn’t trigger while Servoy was in search mode, that would relieve some of the pressure for knowing what mode we’re in. However, onRecordSave really is triggering in the find mode. If I type in a request and click the background, it triggers. When I create a new request (Ctrl+N), the onRecordSelection method triggers.
Actually, something that’s triggering not only runs a method to “validate” the request, but also puts the system back in “ready” mode… sort of. I’ve managed to crash Servoy a couple of times trying to test it out for this response, and also keep ending up with the status bar saying ‘Ready’, but with my find request still showing on screen. Weirdness all around.
I’ll continue to research that, but for now, let me just say that scripts in my solution are demonstrably not disabled in the find mode.
In any case, back to my original question: How can I tell when the user is “back” from the find mode? Aside from the whole method triggering issue, I want to set/unset the background color when the user is in find.
are you saying that when you are in Find Mode (CTRL-F) and then make a new reecord (CTRL-N) before you search (F3) you get onRecordSelection events ect? Or recordSave when you press on the gray area.
This shouldn’t happen and i have tested this and those events are not called.
I get both.
Found I was using JRE 1.4.1
Upgraded to 1.4.2
When I’m in Find mode, events still trigger.
Can you confirm for me… you’re saying that when you are in find, NONE of the methods work? Or just the event-triggered methods?
I’m quite concerned, here. I can clearly demonstrate methods kicking off in find mode. onEditStart, onNewCmd, etc.
at my place i can’t reproduce this.
I will get back to you on this behaviour in the next few days.
to close this post: This is fixed, because global methods where still called through specific ways.