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.
My code to exit is shown below. 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" thenNullEnd 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 linesxx=Send_Event(NextPrompt,"GOTFOCUS")[b]xx=Send_Event(CtrlEntId,"LOSTFOCUS"[/b]EndEnd
* 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=PUB_EDT. 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.
[email protected] onmouseover=window.status=imagine … ;return(true)"
Ray Chan ~ Symmetry Info
Ray,
I don't have such a control in my form.
Check the form's SYSREPOSWINS row with the System Editor (but exit without saving). From line 4 and onwards (until the ÿMENU line) all your controls are listed - in tab order. No trace of the elusive PUB_EDT there either?
Btw - the name you get from the NEXT property should contain form name too (.).
You don't create controls dynamically, do you???
The Stack Overflow could be caused by sending an event to itself, or perhaps by an event A sending B, which again triggers A. Perhaps LOSTFOCUS triggers POSCHANGED?
- Oystein -
Oystein,
Thanks for your response. I figured out the problem (see response on otherside).
FYI, I did check the SYSREPOSWINS in the System Editor. The "bogus control" was not in the form, but created on the fly for the EditTable .
In brief, my problem was caused by a promoted event for POSCHANGED. Once I determined this to be the 'bad boy', I changed the program to dynamically assign an appropriate Return Value for the POSCHANGED event. That is, if "NONE", then RtnCode=False$ Otherwise RtnCode=True$.
I think you cautioned me on using Promoted Events. They are powerful, but they can bite you when you least expected it. I probably spent most of one day trying to work out this "simple problem". It was driving me daffy. I tried this. I tried that. I changed this. I took this out. I put something else in, etc. I did a hundred different things to figure out why the simple code didn't work. Why oh why. Any case, now that things work (for now), I'm happy. I think that I can now go for my slow jog.
Thanks again,
[email protected] onmouseover=window.status=imagine … ;return(true)"
Ray Chan ~ Symmetry Info
Ray,
Just a reflection….- and recognise problem solved - but… In your original code you had a
Send_Event(CtrlEntID,"LOSTFOCUS")chances are that the control may have had some parameters so correctly would be
Send_Event(CtrlEntID,"LOSTFOCUS",Flag,FocusID)My point is that you should where possible pass the correct parameters on an event.
Richard Bright
Richard,
Appreciate the advise.
Ray
[email protected] onmouseover=window.status=imagine … ;return(true)"
Ray Chan ~ Symmetry Info
I'm happy. I think that I can now go for my slow jog.
I'm happy too. I just had a Kwak (Belgian beer). That's exercise enough for me.
- :)ystein -
Oystein,
I'm happy too. I just had a Kwak (Belgian beer). That's exercise enough for me.
Pauwel Kwak Beer (since 1791) . Never tried it, but I'm sure it's good. Is there a high tariff on beer coming into Norway from Belgian? If so, it must be good if you're drinking it.
Cheers. Hey let's set a good example and do some cross-country skiing.
[email protected] onmouseover=window.status=imagine … ;return(true)"
Ray Chan ~ Symmetry Info
Ray,
High tariff indeed. This particular beer I bought while travelling, though.
But high taxes or not - Belgian beers are worth their price. Just watch out for the strong ones. One too many and you lose focus. Ha ha!
- Oystein -
Oystein,
One too many and you lose focus. Ha ha!
You are too funny .
BTW, it doesn't require a strong beer to make me lose focus.
[email protected] onmouseover=window.status=imagine … ;return(true)"
Ray Chan ~ Symmetry Info