Returning Focus to a form (OpenInsight Specific)
At 04 FEB 2000 09:00:04PM Bruce wrote:
Hello,
I have a Click event on a button that executes a stored procedure. In the stored procedure, the following code is executed if an error is encountered. I was hoping this code would cause control to return to the form so that the user could make the data-entry correction; however, the program continues to execute.
Def='
Def=BO
Def=This is a test'
Def=Test'
x=msg( @window, Def)
Set_Property('SYSTEM','FOCUS',@window:'.FERT_JV_BUILD')
Thanks Bruce
Also, I have tried the send_event as well.
At 04 FEB 2000 09:18PM J. Shaefer wrote:
Why don't you setup the click event from the button to call the OMNIEVENT of the screen and then call the program from that area?
Just make sure that the program has a 'return' in there and then you won't have to worry about setting the focus from the program that you called. When the 'return' executes, you can set the focus for the prompt that you want from withing the OMNIEVENT.
Let me know if that helps.
At 05 FEB 2000 02:42PM David Pociu wrote:
Bruce,
I would like to point out that you might have misunderstood my previous answer…
It looks to me as if you're trying to give focus to a certain control in a window. In order to do that use
Set_Property( @window:'.FERT_JV_BUILD' , 'FOCUS' , 1 )
and not
Set_Property('SYSTEM','FOCUS',@window:'.FERT_JV_BUILD')
The set_property should also be one of the last things that the procedure executes before a return.
Hope that helps,
Dave
At 08 FEB 2000 06:31PM John Gunther, Bucks vs Bytes wrote:
You say "the program continues to execute". Does this imply that you aren't ending the CLICK event handler with RETURN 0 right after the set_property command? If not, my experience is that the expected behavior would be for your program to finish and then focus going to FERT_JV_BUILD.
John