Kbase P139672: Changes made through ActiveX object on SmartDataViewer are not saved when record is saved
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  13/01/2009 |
|
Status: Unverified
SYMPTOM(s):
Changes made through ActiveX object on SmartDataViewer are not saved when record is saved
Screen value changes back to original value when Save button is clicked on SmartToolbar
FACT(s) (Environment):
ActiveX object works correctly up until Save button is pressed.
Changes to fields represented by OpenEdge GUI widgets are saved correctly.
SmartDataViewer displays detail of current row in associated SmartDataBrowser
Data from SmartDataObject is assigned by application code to ActiveX object property in displayFields method override.
Windows
OpenEdge 10.1C
CAUSE:
displayFields is called from initializeObject in the SmartDataViewer and from onValueChanged in the SmartDataBrowser, but also from updateRecord in the SmartDataViewer. The code that initialized the Activex object was called a second time when the user's updates were being saved, and overwrote the values entered by the user.
FIX:
Modify the application code as follows so changes made to the ActiveX object by the user are not overwritten:
Add a logical variable to the application code to serve as an update switch. Its initial state should be unset.
Override the updateRecord method.
Set the update switch in updateRecord before the super procedure is run.
Unset the update switch in updateRecord after the super procedure is run.
Add conditional code to the displayFields override so that the ActiveX value property is not overwritten when it has been updated.