StrataFrame Forum

BO Translation from User Control Browse Dialog

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

By Kenneth Langley - 2/17/2009

Lets see if I can explain this. I have a SF user Control with DevExpress Layoutcontrols. Inside the layout control I have SF Text boxes and a button from which I am calling a browse dialog. The browse dialog is a search of the address table. In the click event of the button I call the browse dialog and search and find four rows. On the main form that I dropped the user control , I have BO translations setup for the address. The browse dialog contains 4 rows and should be translated back to the main form address BO. This is not occurring.

Questions ?

1.) Will the BO Translations work in this manner ?
2.) Does embedding the browse dialog in this manner prevent the BO translations ?
3.) What is the full explanation of the translation object property and should it be used in this situation ?

Thanks in Advance

Kenneth Langley

By Kenneth Langley - 2/17/2009

Follow up:

The BOTranslation seems to not be the problem after all. I discovered that if I add these two lines of code just before calling the Browse Dialog it works as it should. Question, Why do these settings in the designer not being respected ? Is it the level at which the browse dialog resides ?


BrowseDialog.BusinessObjectToPopulate = [Business Object]
BrowseDialog.BusinessObjectType = ["Business Object type"]

 

OK Trent, this one's for you...

By Trent L. Taylor - 2/17/2009

There has been discussion on other threads in this regard.  I beleive that I have answered this for Greg in another section.  But here it the issue, it has nothing to do with the browse, but the translation.

The BusinessObjectToPopulate is still looking at the original BO instance instead of the translated instance even after the BO translations have taken place.  This is as designed at the moment.  The problem is that if we were to reflect over every object on the form looking for the original instance to translate, things would get really slow and sluggish.  All of the translations take place in the load.  So for future reference, if you run into something like this, place your code to update these references with the translated object after the base Load logic.

MyBase.OnLoad()

'-- Update the references here as the form instances will be translated at this point

By Kenneth Langley - 2/18/2009

Thanks for the explanation. This is the first instance of where the BO translations did not work. Still loving the product.

Thanks,

Kenneth Langley
P.S. Lost 48 pounds and shrinking.

By Trent L. Taylor - 2/18/2009

Great to hear on your health, Ken! 

As for the translations, they actually worked as designed, as I mentioned, but the instance of a downstream object has to be manually updated to the translated object after the Load.  Since the BO instance dropped on the form is what gets translated, if there is an object (i.e. a BusinessObjectToPopulate) property set to the original object instance, it has to be updated after the Load.  That is what I was talking about on the reflection side of things.  If we were to reflect over every object on the form looking for any other instance that need to be "swapped" over to the translated instance, it would get REALLY slow. 

At any rate, great to hear that you are doing well and got it going!