ChildFormDialog & ParetnBusinessObject


Author
Message
Larry Caylor
Larry Caylor
StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)
Group: Awaiting Activation
Posts: 592, Visits: 3.7K
I had an issue with a parent/child object relationship. It's working now but I'd just like to understand what was going on.

Form 1
     Contains BO1
     BO1 is passed to Form 2 using a ChildFormDialog

Form 2
    Contains BO1 translated by CFD
    Contains BO2 (ParentBusinessObject set to BO1 in the designer)

At runtime the ParentBusinessObject property for BO2 is Nothing even though it was set to BO1 in the
designer. If I set the relationship in code on Form 2 everything works as it should. I'm assuning that the
translation of BO1 by the ChildFormDialog is messing up the relationship set in the designer.

Replies
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Yup, Greg.  This is the very thing that we went through on the other thread.  I had trouble finding it also (didn't try too hard).  But in short here is the issue.  It has to do with the BO translations.  All of the translations get taken care of during the OnLoad of the form or user control.  All standard properties and instances get converted.  However, downstream instances to not get replaced, such as a BusinessObject property on a list.  This is because we do not reflect over every object and instance of every object on the form.  We update the BO references (components) and the ParentBusinessObject properties of the converted BOs, but we do not know about all of potential references, nor should we reflect over everything as this would be painfully slow.

So in these types of instances you do exactly what you did and update the instance in code AFTER the OnLoad base logic has executed.

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Thanks Trent. I think that is the last piece (what exactly is getting translated) of the puzzle. For me (being a bit slow), it took a while for my brain to wrap around the "why", but once I got that, it all made sense. Larry, being the sharp guy he is, probably had this figured out a lot quicker than I did!



Great idea for the VS template Edhy! Better than my current "crap why didn't that work...???...oh, I forgot to set the BO after translation" method. Tongue
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