Need help with Form Control - Protecting a Field (None Specified)
At 09 MAR 1999 01:41:14AM Randy Richard wrote:
Am converting an application from AREV and am in the middle of my first screen, wanting to protect and unprotect fields, set values based on the type of record selected, etc.
Since most of the conditions relate to the type of record selected, these operations could also be done POST READ, which I will experiment with shortly.
My approach so far has been to use GOTFOCUS, check for conditions in an SSP, then set the appropriate properties (such as ENABLED, DEFPROP). This is mostly successful.
Problem: When I CLICK or TAB to the field in question, GOTFOCUS executes correctly, but the cursor stays in the control. I cannot make an entry, but I am stuck in the field. I cannot TAB away but must CLICK to another control. Then, when I TAB or CLICK back to the field, it is fully protected and I cannot even get in there (which is correct, and the way I wanted it to be when GOTFOCUS was finished the first time).
How can I get the new properties to take effect as soon as the flow leaves GOTFOCUS the first time?
Should I be using a different event?
Are there additional functions I need to use?
Are there additional settings I need to use?
Please help me move on to more important parts of this project…
All assistance fully appreciated.
At 09 MAR 1999 02:16AM Randy Richard wrote:
Am I using the correct properties?
REQUIRED to make it required or optional (like SI )
ENABLED to make it protected/unprotected
DEFPROP to update the data value
NEXT to go to the next prompt in the tab order
PREVIOUS to go to the last prompt in the tab order
At 09 MAR 1999 05:52PM Thomas Dunlop wrote:
Hi Randy:
You're on the right track. The Read event would be the place to put it. I believe you would need to use the forward_event to let the read happen to get the value you need to check and then set the properties based on that value.
Tom Dunlop
Revelation Software
At 10 MAR 1999 08:12AM Randy Richard wrote:
I have now set my control properties off the READ event which works better that trying to do it from GOTFOCUS, especially since the settings are valid for the duration of the current record, and won't change based on any new data entered.
However, the settings do not properly re-set when a new record is entered, or selected, that has a different type. If I alternate between new records and existing records, or between one type and another, the previous record settings survive into the new record.
Is there another setting or function I need to be using in order to fully activate and control the properties. SET_PROPERTY does not seem to be enough. REDRAW? CALCULATE? SEND_EVENT? SEND_MESSAGE?
Thanks.
At 10 MAR 1999 12:38PM Oystein Reigem wrote:
Randy,
…the previous record settings survive into the new record.
If you set properties for window controls they will survive until you close the window and re-open it again, unless you reset them somewhere. (Note that some properties have corresponding ORIG_ properties which make it easier to set the property back to what it was at design time.)
- Oystein -