StrataFrame Forum

SFUserControl BOTranslation

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

By Scott - 8/18/2006

When does the BOTranslation take place, at what point in the object creation process?  Is there any error messages if the process doesn't work?  I know that the translation work becuase it is working in one of my controls but in this new control it doesn't seem to be working.  Any idea where I should start looking?
By StrataFrame Team - 8/18/2006

Make sure that the ParentContainer property of the user controls is being set when you drop it on the form... that's where I'd start looking.
By Scott - 8/18/2006

It is set correctly.
By Scott - 8/18/2006

I know it was set correctly the first time I checked it.  Now it appears that it is blank.  How would I go about getting this property set.  I can't set it before InitilizeComponet and when I set it after InitilizeComponet the system just hangs.
By StrataFrame Team - 8/18/2006

It's supposed to get set through the designer.  When you drop the control on the form, it will evaluate the property and set the value to the parent control.

If you need to manually translate the business objects, you can try this:

((MicroFour.StrataFrame.UI.IInitOnFormLoad)this.MyUserControl).InitializeObject();

The translations of the business objects occurs within that method, so you might give it a shot.

By Scott - 8/18/2006

After about 3 minutes I get:

OutOfMemoryException
 Exception of type 'System.OutOfMemoryException' was thrown.

Source     : mscorlib

Stack Trace:
   at System.Collections.Generic.List`1.set_Capacity(Int32 value)
   at System.Collections.Generic.List`1.EnsureCapacity(Int32 min)
   at System.Collections.Generic.List`1.Add(T item)
   at MicroFour.StrataFrame.Business.BusinessLayer.CopyBoundControlsFrom(BusinessLayer BusinessObject)
   at MicroFour.StrataFrame.UI.Windows.Forms.BusinessObjectTranslator.TranslateBusinessObjects(BusinessObjectTranslationCollection Translations, ContainerControl SourceContainer, ContainerControl DestinationContainer)
   at MicroFour.StrataFrame.UI.Windows.Forms.UserControl.InitializeObject()
   at MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.InitializeFormLoadObjects()
   at MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

but it did work translate the BO's. Any suggestions?

By StrataFrame Team - 8/18/2006

I'm not sure, Scott.  We have the ability in the next version to share data tables between business objects (for situations just like this, when the translation is a little fuzzy).

Does this control you're using inherit from MicroFour.StrataFrame.UI.Windows.Forms.UserControl, or is it custom and implements the IContainerControl on its own?

By Scott - 8/18/2006

It inherits from the SF UserControl.  When you say the next version are you meaning 1.5?