BO translation and subclassing


Author
Message
dgsoft
dgsoft
StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)
Group: StrataFrame Users
Posts: 93, Visits: 236
Hi, I have an environment

Step1.

[UserControl1 (based on SF userControl)

_|___ UserControl2 (based on SF userControl)

_|_________|____ BO2

_|___BO1



Between BO1 and BO2 I have translation.



Step2.

[Form]

__|___ UserControl1

__|________|___ BO1

__|__BO0



Between BO0 and BO1 I have translation.



This combination works perfect.



Step3.

I create UserControl3 based on UserControl1 !!!

When form starts I'v got an error message now. (below)

It seems in subclassing my BO translation lost. I try to make BO as Public but it does not help.

Any idea?





BusinessLayerException

The business object [BO1] could not be located. It is most likely this object was deleted or renamed.



Source : MicroFour StrataFrame UI



Stack Trace:

bei MicroFour.StrataFrame.UI.Windows.Forms.BusinessObjectTranslator.GetBusinessObject(ContainerControl ParentControl, String BusinessObjectName)

bei MicroFour.StrataFrame.UI.Windows.Forms.BusinessObjectTranslator.TranslateBusinessObjects(BusinessObjectTranslationCollection Translations, ContainerControl SourceContainer, ContainerControl DestinationContainer)

bei MicroFour.StrataFrame.UI.Windows.Forms.UserControl.TranslateBusinessObjects()

bei MicroFour.StrataFrame.UI.Windows.Forms.UserControl.InitializeObject()

bei MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.InitializeFormLoadObjects()

bei MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.OnLoad(EventArgs e)

bei System.Windows.Forms.Form.OnCreateControl()

bei System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)

bei System.Windows.Forms.Control.CreateControl()

bei System.Windows.Forms.Control.WmShowWindow(Message& m)

bei System.Windows.Forms.Control.WndProc(Message& m)

bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)

bei System.Windows.Forms.ContainerControl.WndProc(Message& m)

bei System.Windows.Forms.Form.WmShowWindow(Message& m)

bei System.Windows.Forms.Form.WndProc(Message& m)

bei System.Windows.Forms.Control.ControlNativewindow.OnMessage(Message& m)

bei System.Windows.Forms.Control.ControlNativewindow.WndProc(Message& m)

bei System.Windows.Forms.Nativewindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
If I'm following you, you likely need to make the field under the BO to be protected. That will make is available to sub-classes. You can change this in the designer, under the Design category in the property window, the Modifier property. If it's set to private, then this could be your problem. If it's already set to something else, then we'll have to dig deeper.
dgsoft
dgsoft
StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)
Group: StrataFrame Users
Posts: 93, Visits: 236
Hi,

UserControl3 inherits UserControl1.



On userControl1 I made BusinessObject public . I expect it will visible for the new Form for BO translation also (new form where I going to place UserControl3), but..



When I put UserControl3 on the form and try to make BO translation, in the Wizard form - I can see NO business object. Just for example, when I drop in design time some new business object to UserControl3 - its avaliable for translation in new form. But if BusinessObject comes from inherited UserControl1 - its not available.



But as I told before.. error comes from case when



UserControl3 Inherists UserControl1..

and UserControl1 has BusinessObject and translation with UserControl2 (userControl2 located in the userControl1 and has same BO).



As I thinking.. the Public Modifier initialize BusinessObject in UserControl3 more late then its using in parent UserControl1 to initialize Translation. and If I use Private BusinessObject - I can't made new translation with new form where UserContrl3 placed.



I hope I explain it good enough.. Smile
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
At this point, a small sample app would really help. Then I could open it and not only see what's going on, but also offer suggestions (or cry for help Blink from Trent et all). I'd suggest you make a sample app using BOs from the StrataFrameSample, that way I'll have the data/structures already and it will keep it simple.
dgsoft
dgsoft
StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)
Group: StrataFrame Users
Posts: 93, Visits: 236
Hi,

I reproject logic Smile It seems better to place class instance then subclass it.



Thanks

Denis
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Glad you got it going. BigGrin
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search