[[https://www.revelation.com/|Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community]] ==== Stack Overflow w/Send_Event to LostFocus (OpenInsight Specific) ==== === At 07 SEP 2000 02:45:37AM rayc@symmetryinfo.com wrote: === {{tag>"OpenInsight Specific"}} To all, This should be simple, but I am encountering a couple of problems. I want to leave an EditTable programmatically when the value of "NONE" is entered in Column 1 of the EditTable. There are three columns: 1) Location; 2) Area Code; and 3) Phone. [u]My code to exit is shown below.[/u] It is called from POSCHANGED of the EditTable (PHONE_ET): * pCol=Column 1 and determined earlier if pCol eq 1 Then If Data Ne "NONE" then Null End Else * Entered "NONE" * leave EditTable for Next Prompt [b]NextPrompt=Get_Property(CtrlEntId,'NEXT')[/b] *NextPrompt= 'PAT_REG.EMAIL' Set_Property('SYSTEM','FOCUS',NextPrompt) * let's try these lines xx=Send_Event(NextPrompt,"GOTFOCUS") [b]xx=Send_Event(CtrlEntId,"LOSTFOCUS"[/b] End End ***** End of Code ***** I am encountering these two problems: 1) The Get_Property(CtrlEntId,'NEXT') is returning an invalid value for NextPrompt. That is, it is returning a val=[b]PUB_EDT.[/b] I don't have such a control in my form. Honest, I've looked and looked. I have also checked my Tab Order. The Next control should be "EMAIL". Does anyone have any ideas why the correct "NEXT" control is not being returned? and where this bogus control name is coming from? 2) To leave the EditTable, I had to add this line: xx=Send_Event(CtrlEntId,"LOSTFOCUS") However, when I do, it cause a Stack Overflow, but it will let me leave the EditTable. I can see that the cursor is now on column 2, but it looks like it's flickering. I guess that's what will cause the overflow. If I take out the Send_Event "lostfocus", I don't get the stack overflow problem, but the cursor stays in the EditTable. Am I happy or am I sad? Any wild ideas or kind explanation would be appreciated. Thanks. I will also post this on the otherside. rayc@symmetryinfo.com onmouseover=window.status=imagine ... ;return(true)" [url=http://www.symmetryinfo.Com" onMouseOver=window.status=Imagine ... ' ;return(true)]Symmetry Info[/url] Ray Chan ~ Symmetry Info ---- === At 07 SEP 2000 03:48AM Simon wrote: === Ray, I am not sure why the Next is returning the incorrect column (have you tried editting the WinExe in System editor to check for the Pub_Edt control ??), but I would recommend replacing the Send_Event to Gotfocus with a Post_Event. Simon Wilmot Rebus Software ---- === At 07 SEP 2000 08:52AM Don Bakke wrote: === Ray, I definitely know the answer to #1 and I think I know the answer to #2. Here goes nothing : 1) You [b]do[/b] have a control called PUB_EDT. This is your drop down button that is created with the Create_Cell_Button routine. 2) I believe the Stack Overslow is happening because you are creating an infinite looping with your code. Sending a LOSTFOCUS event to the edittable effectively calls the POSCHANGED event which calls the LOSTFOCUS event again and so on. I don't understand the need to use Sent_Event in your code since the LOSTFOCUS/GOTFOCUS events should fire on their own anyway based on the way you are changing the FOCUS. dbakke@srpcs.com [url=http://www.srpcs.com]SRP Computer Solutions, Inc.[/url] [img]http://www.srpcs.com/srpicon1.gif[/img] ---- === At 07 SEP 2000 09:16AM X wrote: === If you get Overslow it's time for another cup of coffee. ---- === At 07 SEP 2000 01:22PM rayc@symmetryinfo.com wrote: === Don and Simon, Thanks for your response. Bottomline, I fixed this situation. 1)Problem #1: Bogus Control (PUB_EDT see Don's comment). To work around this, I just issued another Get_Property for "Next". That is: NextPrompt=Get_Property(CtrlEntId,'NEXT') NextPrompt=Get_Property(NextPrompt,'NEXT') 2)Problem #2: Convoluted, extraneous Send_Event statement needed to Lose focus, but caused Stack OverFlow. Well I finally debugged the culprit. I also have a POSCHANGED in my Promoted Event which "interfered" with my intent . After I discovered this, my simple solution was to assigned a value of "0" to the return code in the POSCHANGED event when the user entered "NONE". Now the code is straightforward (as you would expect) and no Stack Overflow!! Thanks for your help. rayc@symmetryinfo.com onmouseover=window.status=imagine ... ;return(true)" [url=http://www.symmetryinfo.Com" onMouseOver=window.status=Imagine ... ' ;return(true)]Symmetry Info[/url] Ray Chan ~ Symmetry Info [[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=NONWORKS_READ&SUMMARY=1&KEY=EF5C01EEAF52828F85256953002522C6|View this thread on the forum...]]