VERSIONS: All
SUBJECT: TableFrame - record object's arrive() event
BY: MARK PAUKER and BERTIL ISBERG
Date: 26 June 1996
PROBLEM:
I have a table frame on a form that is used for data entry. The arrive method of the TFrame's record has code that will, after dodefault, move the
cursor to field 3, where data entry should start for the record. However, I observe the following when pressing [Enter] after entering data in the
last field of any TFrame record: the cursor moves to the first field of the next record and stays on that field instead of being moved to field 3 by the
record's arrive method. Why doesn't the arrive method operate in this circumstance?
I did eventually find a way around the arrive method anomaly using the run-time tab stop property. But do you know why the arrive method
didn't work? I'm trying very hard to understand this very complex event model.
BY : MARK PAUKER
I just re-created what I think you did, and it works for me everywhere but in the bottom row of the tableFrame. (In the record's arrive method I
placed the command: thirdField.moveTo(), where "thirdField" is the name of the third field in the tableFrame.) I'm not sure why you would have
experienced anything different, although it doesn't really matter since this technique still doesn't work when pressing Enter from the last field of
the last row.
The easiest way to fix this is probably to use postAction to accomplish the move.
BY: BERTIL ISBERG
I did some simple tests on this and noticed : When you leave an inserted record that isn't posted but unlocked, and the record flies away, your
problem will occur. But when editing existing records, the problem only appears when a scrolling is involved.
The solution is:
In record's arrive event
doDefault
self.postAction(UserAction+1)
In the record's action event
if eventinfo.id()=UserAction then
disableDefault ; to prevent UserAction from bubbling
; if statement needed to handle DataDeleteRecord on last record when third field is active
; and maybe only when AutoAppend is on.
if active'name <> "Street" then ; Street is third field
Street.moveto()
endif
endif