Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Enhancement to CBizObjMaintBaseForm
Message
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Title:
Enhancement to CBizObjMaintBaseForm
Miscellaneous
Thread ID:
00359191
Message ID:
00359191
Views:
42
Kevin,
This is slightly difficult and lengthy to describe, so please bear with me. I am using CBizObjMaintBaseForm as the base for another form on which I have added a custom container class based on CTextBoxl. Within the container class is a label, textbox and an ellipses button. The ellipses button is used to activate a find form for something such as a company name or a contact name. On this particular form there are about five of these lookup fields.)

Everything works fine with this scenario the exception of a small annoyance. When returning from the lookup form, which is modal and returns a value, the container class has already modified the data when the Activate method of pgfBizObj.Page1 is executed. As you may recall, contained within the Activate method is the AskToSave() function which is primarily designed to work when changing pages (I think) and not when changing forms. However, I did find a workaround which you may or may not see fit to include in the original framework. What I have done is to add a property to the form called lFormActive which is set to .F. in the base class. In the Activate for the form, I have added the code:
ThisForm.lFormActive = .T.

while in the Deactivate method I have added the code:
ThisForm.lFormActive = .F.


I then needed to add the proper code to the Activate method of Page1:
IF ThisForm.lFormActive
*----------------------------------------------------------------
*-- If user has added a new record but not yet made any changes,
*-- then cancel the add. If that was the last record, then do not
*-- allow entry into the page.
*----------------------------------------------------------------
....

*------------------------------------
*--- Set the AddMode flag to FALSE
*------------------------------------
ThisForm.lAddMode = .F.

ENDIF && ThisForm.lFormActive

This has seemingly solved the issue and allows the form to function as it normally would. If you have any additional information or foresight, please let me know.'

Thank You,
Justin L. Spies
Next
Reply
Map
View

Click here to load this message in the networking platform