General information
Category:
The Mere Mortals Framework
Title:
Bug in cBaseForm TrueActiveControl Method
I believe there is a bug in the TrueActiveControl method in the cBaseForm class, at least when running under VFP 7.0.
It manifests by asking if you want to save each record as you step through records using the toolbar navigation arrows when a cBizObjMaintenanceForm with incremental seek in the grid is active, and the columns in the grid in the cListOneToManyObj have been re-arranged, such that, for example, column[1] is no longer displayed first in the grid.
In this case, the wrong column is being returned as the ActiveControl to the cBizObjForm WriteBuffer method and, depending on the data, this results in the ActiveControl Value not being equal to the ActiveControl
ControlSource, forcing the WriteBuffer method to incorrectly update the record. It appears that if the grid textbox control is not active, its value is not being properly updated from its control source.
In the TrueActiveControl method of the cBaseForm class, if the following lines:
LOCAL lcGridControl
lcGridControl = "loControl.Columns(loControl.ActiveColumn)." + ;
loControl.Columns(loControl.ActiveColumn).CurrentControl
loControl = &lcGridControl
are replaced with these lines:
* ActiveColumn refers to columnOrder sequence,
* not sequence in columns array. Find the real active column
LOCAL loColumn
FOR EACH loColumn IN loControl.Columns
IF loColumn.ColumnOrder = loControl.ActiveColumn
loControl = loColumn.currentControl
EXIT
ENDIF
ENDFOR
then the proper column is returned to the cBizObjForm WriteBuffer method, and things work properly.
June
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only