Business Object and StrataFrame controls in User Control


Author
Message
Jiri Brazda
Jiri Brazda
StrataFrame Novice (124 reputation)StrataFrame Novice (124 reputation)StrataFrame Novice (124 reputation)StrataFrame Novice (124 reputation)StrataFrame Novice (124 reputation)StrataFrame Novice (124 reputation)StrataFrame Novice (124 reputation)StrataFrame Novice (124 reputation)StrataFrame Novice (124 reputation)
Group: StrataFrame Users
Posts: 78, Visits: 356
I would like to use user controls in my web application. However I'm not able to bind strataframe components like textbox etc. on my user control to business object. In one of previous topics about this problem it was mentioned the following:

Web controls are a little different than winforms controls, but you can still use them. You can call whatever strataframe controls you need to inside of your web control, but you will have to take the binding for them into account in the render method of your web control. In winforms it handles the equivelant functions for you, but in web you have to do it yourself.

Outside of that, you're free to use them as you wish 

Could anybody put here a piece of code or a very simple sample that would demonstrate how to do it?

Thank You.

Jiri Brazda

Trent Taylor
Trent Taylor
StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Well, this would depend on your user control, Jiri.  This comment is telling you that you will have to do one of hte following with your custom user control:

  1. Implement IWebBusinessBindable interface to your user control so that you can directly bind an SF BO.
  2. Make sure that your control supports a System.Web.UI.DataSourceControl and then bind to it using the WebBusinessBindingSource (SF control).

There are some other options as well.  But the first thing is that you need to come up with a way to bind your user control to either any binding source or an SF BO or both.  Once this is done, then it will make it easier to tell you what may need to be done within your user control.

Jiri Brazda
Jiri Brazda
StrataFrame Novice (124 reputation)StrataFrame Novice (124 reputation)StrataFrame Novice (124 reputation)StrataFrame Novice (124 reputation)StrataFrame Novice (124 reputation)StrataFrame Novice (124 reputation)StrataFrame Novice (124 reputation)StrataFrame Novice (124 reputation)StrataFrame Novice (124 reputation)
Group: StrataFrame Users
Posts: 78, Visits: 356
OK, I'm trying the first alternative. My usercontrol implemments IWebBusinessBindable with necessary properties like BindingField, BusinessObjectName etc. However I do not know waht to do next? When I put SF TextBox on usercontrol surface and then try to set BusinessObjectName of the SF textbox, the following error is displayed:

InvalidCastException
  Unable to cast object of type 'System.Web.UI.UserControl' to type 'MicroFour.StrataFrame.UI.Web.IBasePage'.

Source     : MicroFour StrataFrame Extensibility

Stack Trace:
   at ᜅ..ctor(IWindowsFormsEditorService A_0, String A_1, Object A_2)
   at MicroFour.StrataFrame.Extensibility.BusinessObjectNameTypeEditor.EditValue(ITypeDescriptorContext context, IServiceProvider provider, Object value)


Trent Taylor
Trent Taylor
StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Ah....yeah, you will have to implement IBasePage as well on your user control.  All SF webcontrols are expecting that implementation.  You can look at the BasePage class in the SF source to see how to implement it.
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