Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Defining parent object programmatically
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Divers
Thread ID:
00696552
Message ID:
00698104
Vues:
16
>Hi Paul,
>
>Does it mean that I don't need to make any changes with my current parent-children bus object relationship? It is because I defined their relationship through the biz object Builder window.
>
>What I need to add is calling SetPrimaryBizObj and RegisterChildBizObj to set a new parent business object? If I want to set the parent biz object back to the original, I will call these two methods again. Is my understanding right?
>
>Thanks a lot again,
>
>Nerissa

I wouldn't use the builder to define the relationships. I would programmatically set them. In addition to adding a child, you will need the UnregisterChildBizObj() or UnregisterAllChildren(), if your child relationships change with the new primary bizobj. For example, you have a form with three bizobjs. At runtime, oSampleBizObj was set as the primary, and oChildBizObj was set as a child of it. oAnotherSampleBizObj is just on the form and isn't directly related to either of the other two.

oSampleBizObj (Primary)
-> oChildBizObj (Child)

oAnotherSampleBizObj (not Primary or Child)

If oAnotherSampleBizObj needed to become the primary bizobj, and oChildBizObj needed to become the child of it (instead of oSampleBizObj), your code might look like:
* Unregister the children first...
ThisForm.oBizObj.UnregisterAllChildren()

* Make oAnotherSampleBizObj the primary, and assign it's children
ThisForm.SetPrimaryBizObj(ThisForm.oAnotherSampleBizObj)
ThisForm.oBizObj.RegisterChildBizObj(ThisForm.oChildBizObj)
HTH
-Paul

RCS Solutions, Inc.
Blog
Twitter
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform