# Status(CurrentMode)

**URL:** <https://forum.servoy.com/t/status-currentmode/2827>\
**Category:** Classic Servoy\
**Created:** [October 4, 2004, 9:29pm UTC](https://forum.servoy.com/t/status-currentmode/2827 "2004-10-04T21:29:15Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Providence1](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@Providence1](https://forum.servoy.com/u/Providence1)\
**Post date:** [October 4, 2004, 9:29pm UTC](https://forum.servoy.com/t/status-currentmode/2827/1 "2004-10-04T21:29:15Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![IT2Be](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@IT2Be](https://forum.servoy.com/u/IT2Be)\
**Post date:** [October 4, 2004, 9:32pm UTC](https://forum.servoy.com/t/status-currentmode/2827/2 "2004-10-04T21:32:09Z")

</div>

Can you please explain what you are trying to archieve?

---

<div class="post-metadata">

**Author:** ![Providence1](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@Providence1](https://forum.servoy.com/u/Providence1)\
**Post date:** [October 4, 2004, 10:19pm UTC](https://forum.servoy.com/t/status-currentmode/2827/3 "2004-10-04T22:19:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![IT2Be](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@IT2Be](https://forum.servoy.com/u/IT2Be)\
**Post date:** [October 4, 2004, 10:24pm UTC](https://forum.servoy.com/t/status-currentmode/2827/4 "2004-10-04T22:24:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Providence1](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@Providence1](https://forum.servoy.com/u/Providence1)\
**Post date:** [October 4, 2004, 11:03pm UTC](https://forum.servoy.com/t/status-currentmode/2827/5 "2004-10-04T23:03:01Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Riccardino](https://avatars.discourse-cdn.com/v4/letter/r/41988e/32.png) [@Riccardino](https://forum.servoy.com/u/Riccardino)\
**Post date:** [October 5, 2004, 6:24am UTC](https://forum.servoy.com/t/status-currentmode/2827/6 "2004-10-05T06:24:32Z")

</div>

> 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.

---

<div class="post-metadata">

**Author:** ![Cain](https://avatars.discourse-cdn.com/v4/letter/c/85e7bf/32.png) [@Cain](https://forum.servoy.com/u/Cain)\
**Post date:** [November 27, 2004, 9:19pm UTC](https://forum.servoy.com/t/status-currentmode/2827/7 "2004-11-27T21:19:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [November 29, 2004, 4:50pm UTC](https://forum.servoy.com/t/status-currentmode/2827/8 "2004-11-29T16:50:37Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Cain](https://avatars.discourse-cdn.com/v4/letter/c/85e7bf/32.png) [@Cain](https://forum.servoy.com/u/Cain)\
**Post date:** [November 29, 2004, 5:22pm UTC](https://forum.servoy.com/t/status-currentmode/2827/9 "2004-11-29T17:22:00Z")

</div>

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. ![;-)]( "Wink")

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.

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [November 29, 2004, 9:32pm UTC](https://forum.servoy.com/t/status-currentmode/2827/10 "2004-11-29T21:32:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Cain](https://avatars.discourse-cdn.com/v4/letter/c/85e7bf/32.png) [@Cain](https://forum.servoy.com/u/Cain)\
**Post date:** [November 29, 2004, 10:43pm UTC](https://forum.servoy.com/t/status-currentmode/2827/11 "2004-11-29T22:43:29Z")

</div>

I get both. ![:-(]( "Sad")

---

<div class="post-metadata">

**Author:** ![Cain](https://avatars.discourse-cdn.com/v4/letter/c/85e7bf/32.png) [@Cain](https://forum.servoy.com/u/Cain)\
**Post date:** [November 30, 2004, 3:37pm UTC](https://forum.servoy.com/t/status-currentmode/2827/12 "2004-11-30T15:37:29Z")

</div>

Found I was using JRE 1.4.1

Upgraded to 1.4.2

When I’m in Find mode, events still trigger.

---

<div class="post-metadata">

**Author:** ![Cain](https://avatars.discourse-cdn.com/v4/letter/c/85e7bf/32.png) [@Cain](https://forum.servoy.com/u/Cain)\
**Post date:** [December 2, 2004, 1:58pm UTC](https://forum.servoy.com/t/status-currentmode/2827/13 "2004-12-02T13:58:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [December 2, 2004, 2:09pm UTC](https://forum.servoy.com/t/status-currentmode/2827/14 "2004-12-02T14:09:24Z")

</div>

at my place i can’t reproduce this.

I will get back to you on this behaviour in the next few days.

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [December 23, 2004, 3:38pm UTC](https://forum.servoy.com/t/status-currentmode/2827/15 "2004-12-23T15:38:24Z")

</div>

to close this post: This is fixed, because global methods where still called through specific ways.
