Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
RefreshForm() after Form.Delete or cancel
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Titre:
RefreshForm() after Form.Delete or cancel
Divers
Thread ID:
00689490
Message ID:
00689490
Vues:
53
Hi,

I just put a Business Object on a form and put some buttons (Save, Delete, Cancel, etc.) on it where the appropriate form methods are called. Additionally I put some fields on the form. Then I ran the form and noticed that it doesn't get refreshed after Cancel and Delete. After Save, New, Last etc. it got refreshed.

The reason for this behaviour is: I forgot to set the oBizObj.lAutoPrimaryBizObj property to .T. Now I wonder, if it wouldn't be better to have a consistant behaviour. If there isn't any reason against it, I would prefer the behaviour, that the forms always gets refreshed, regardless of the setting of lAutoPrimaryBizObj, since the core functionality works. Then why shouldn't the refresh get done, when the record was actionally deleted?

Here is what causes the different behaviour:
*-- cBizObjForm::Delete

	CASE lnRetVal = FILE_OK
		*----------------------------------------------------
		*--- If the current business object is THE primary
		*--- business object, or at least an auto primary
		*--- bizobj, Refresh the form
		*----------------------------------------------------
		IF ThisForm.oBizObj.lPrimaryBizObj OR ;
		ThisForm.oBizObj.lAutoPrimaryBizObj
			This.SetFilePos()
			This.RefreshForm()
		ENDIF
*-- cBizObjForm::New

	*----------------------------------------  
	*--- Run the business object's New method
	*----------------------------------------
	lnRetVal = this.oBizObj.New()
  
	IF lnRetVal = FILE_OK
		This.PostNewHook()
		this.RefreshForm()
	ENDIF
Looking forward to any comments,
Armin

Armin Neudert
Regional Director (Stuttgart) of German FoxPro User Group dFPUG

MCP for Visual FoxPro

Expert/Editor of the VFP section in the German Codezone community portal
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform