Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bug in cBaseForm TrueActiveControl Method
Message
From
03/12/2004 19:13:57
June Kendrick
Kendrick Associates, Inc.
New York, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Title:
Bug in cBaseForm TrueActiveControl Method
Miscellaneous
Thread ID:
00966876
Message ID:
00966876
Views:
46
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
Map
View

Click here to load this message in the networking platform