What is mustExecuteFocusGainMethod

Being that others will search this forum for answers to this question. Why is it that the requestFocus() method requires mustExecuteFocusGainMethod and how do you go about using it?

My situation is using a custom controller for various forms. When a particular form is loaded I would like the global field within the controller to become the field with focus.

After executing an onAction method for that field I would like the cursor to return into that same field for another search. This allows for multiple searches until the matching criteria is found.

elements.myField.requestFocus( [mustExecuteFocusGainMethod])

The bracketed part is optional. (true/false)
Normally you would use elements.myField.requestFocus() as in your example.

However when myField has an onFocusGainedScript attached to it you can prevent it from executing, when running an other script.

eg.
myField has an onFocusGainedScript that changes the bgcolor whenever you click into it.
There’s also a buttonscript that makes the cursor go into myField, but you don’t want the bgcolor being changed.(onFocusGainedscript)

In this case the buttonscript looks like this:

elements.myField.requestFocus( false)

Maarten and Servoy staff. I would suggest using your forum as a place to allow other developers to elaborate and learn more about functions.

The above explaination of a function will help others who come across this situation.

Create a new topic called “Functions” and then slowly add the functions with their descriptions and use. Then allow other developer to post ideas and uses about them. A good example of a community that does this is PHP.net. Obviously this topic would be moderated because you want to ensure that the suggestions made will work. See the examples at PHP.net

Blueworld does something like this for it’s lasso product:

http://www.blueworld.com/Lasso/LDMLReference.LassoApp

3rd party comments can be added. This is an extremely useful reference tool and I usually have it open while doing heavy duty Lasso coding.

  • david

Cool stuff and good inspiration for us!

We’re working on a concept that should include downloadable sample solutions, code samples, references, flashdemo’s etc.

In the meantime any more suggestions are always welcome.
Thanks a lot!