StrataFrame Forum

BOTranslation from component to childForm

http://forum.strataframe.net/Topic10504.aspx

By Chan - 7/21/2007

Hi,

In my lookedit_ButtonClicked event, I need to launch childform. My BO is created in this event, but not dropped on form.

How could I "translate" my BO to childform?



Thank you
By Trent L. Taylor - 7/22/2007

You have three options, first, just pass the craeted BO over as a parameter to the child form.   Second, manually add the item to the translation collection.

   
    '-- Decalre this as a private on Form1   
    Private _MyBO As MySourceBO   

    '-- Manually add the translation
    Dim loItem As New MicroFour.StrataFrame.UI.Windows.Forms.BusinessObjectTranslationItem()
    loItem.SourceBusinessObject = "Form1._MyBO"
    loItem.DestinationBusinessObject = "Form2._DestBO"
    Me.ChildFormDialog1.BusinessObjectTranslations.Add(loItem)

Last option, manually translate the BOs yourself by calling the translater directly.

MicroFour.StrataFrame.UI.Windows.Forms.BusinessObjectTranslator.TranslateBusinessObjects(SourceBO,DestBO,"DestBOInstanceName",Form1,Form2)