StrataFrame Forum

ParentRelationship property of BO

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

By Scott - 11/24/2005

Once the ParentRelationship property of a BO is set you can still use the BO independently,  right?  It only comes into play once you set the ParentBusinessObject property on the instance of the BO on that form (or if done with code)?

I have a one to many relationship, Quotes and QuoteDetails.  On the quotes form I am displaying the basic quote information along with a listview of all the quote details.  I have a quotebo and a qdetailbo on the form.  This is all working great.  I want to allow the user to click on a line item and have a quote detail form to allow changes,  can this same qdetailbo be used?  Any best practice recommendations?

By StrataFrame Team - 11/25/2005

Yes, the ParentBusinessObject and ParentRelationship work exactly as you said... the ParentRelationship doesn't come into use until the ParentBusinessObject is set and you can most certainly use a "child" business object without setting it's parent. As for best practice recommendations... I would use a "ChildFormDialog" for the window you want to use for changing the quote detail lines. You'll create a form in your project as if it was a standalone form (drop a quoteDetailBo on it and bind all of your fields). Then, drop a ChildFormDialog component on the "parent" form and configure it to call the "child" form. On the ChildFormDialog component, you'll configure the translation between the quotedetailbo on the parent form and the quotedetailbo on the child form. At runtime, the business object on the child form will be "translated" into the business object on the parent form (they'll be the exact same object reference); this allows you to use the same quotedetailbo on both forms without having to create a new one for the child form.



If that doesn't make since, the CHM help file has a better explaination of the ChildFormDialog under the UI Layer book Smile
By Scott - 11/25/2005

I found the childformdialog control, but can only find one reference to it in the documentaion.  I used the search feature and only found childformdialog mentioned under "controling standard form automation".

Thanks for the info I will start playing with it tomorrow.

By Trent L. Taylor - 11/27/2005

The documentation is still not completely published and we are adding new documents all the time. This happens to be one of them. I will create you a sample project in the morning. What language are you working with and I will write it in your preferred language. The ChildFormDialog control is pretty straight forward once you see it in action. I know that if you see an example you will be able to make it work. I look forward to hearing from you. Let me know.Smile
By Scott - 11/27/2005

That would be great.  I am working in C#.

Thanks

By Trent L. Taylor - 11/28/2005

I will try and get you one by this afternoon sometime.  Thanks. Smile
By Trent L. Taylor - 11/28/2005

There is now an update available from the My Account area of the website.  The update includes some enhancements and improvements to the framework as well as a ChildFormDialog sample. 

I hope this helps you get going.  In the sample you will also see an advanced ListView population method which uses an already populated business object by using the CopyDataFrom() method.

You MUST allow the databases to update when loading the new installation because a new table was added to the sample to show a simplified version of the ChildFormDialog control.  Let me know if you have any questions.  Thanks!Wink

By StarkMike - 5/2/2006

I couldn't find the ChildFormDialog sample in the MyAccount area.
By StrataFrame Team - 5/2/2006

Mike,



The ChildFormDialog sample is part of the 1.4 installation. However, it's in C# only, so you'll find it under the Start menu for StrataFrame under the C# samples, not the VB.NET samples.