StrataFrame Forum

Create user control

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

By kkchan - 1/6/2007

Hi,

I would like to create an user control that contains of address, city, country, postal and state. I have business object in this user control that would populate country list and bind to combobox.



After create ths user control, I would like to allow user to bind data to user control's inner controls (textbox and combobox) in form.



How to implement this?



Thank you
By kkchan - 1/7/2007

Hi,

I checked out IBusinessBindable sample, and implemented some code to my user control.

I think the remaining question is, since my user control contains multiple controls. Do you recommend to set all of the relevant properties value to these controls in setter method? Any better place to me to set them only once upon refresh or other event?



Thank you
By Trent L. Taylor - 1/7/2007

You are going down the wong road here.  You need to create your user control based off of the StrataFrame User Control.  This control allows the control to behave just like a form.  Then when dropped on a form, it has a property called BO Translations that allow the forms BO to be used in place of the internal BO in the user control.
By Chan - 1/28/2007

Hi,

I have a master table, called currency. I have more than one table FK refer to currency master table, how could I set data binding to controls inside my user control? Which BO should I used for translation? Create dummy BO or...?



Thank you
By Trent L. Taylor - 1/29/2007

If you are worried about the other tables recognizing the translation, they will.  The object reference is truly changed when the translation takes place.  The SF user control has a property named BOTranslations that allows you to drop the user control on a form and then have the BO on the form translated into the user control. 

So any other BOs that reference the BO on the parent or within the child will be looking at the same business object specified in the "source" translation BO.