Binding controls to business objects at runtime


Author
Message
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
The reason you are having an issue is because the standard SF data binding has already taken place, so I assume that you are just setting the BindingField and BindingBusinessOBject properties after the form has already loaded.  If you want to do this, you need to override the OnLoad method of the form and before you call the MyBase.OnLoad() method, set all of your binding logic.  This is also assuming that you want to use SF data binding.  The second option is to manually create a binding and bind the control to the SF BO property.  Either way will work, but you are fighting instantiation order at the moment.
Cyrus Welch
Cyrus Welch
StrataFrame Beginner (38 reputation)StrataFrame Beginner (38 reputation)StrataFrame Beginner (38 reputation)StrataFrame Beginner (38 reputation)StrataFrame Beginner (38 reputation)StrataFrame Beginner (38 reputation)StrataFrame Beginner (38 reputation)StrataFrame Beginner (38 reputation)StrataFrame Beginner (38 reputation)
Group: Forum Members
Posts: 20, Visits: 82
I'm running into an area where we need to bind the strataframe controls to business objects at runtime.  So far it doesn't seem to work at all, but I admit I might be doing it wrong.

Here's the situation.  We have a meta-table of services received by clients that contains all the services they receive, but only core elements of this information.  Then each category of service has it's own table which contains all the elements for the service.  When creating lists, the meta-table (we refer to it as an intersection table actually) as ALL records for all service categories are contained, so we can show ALL services received.  But when editing we edit the parent table, and then mirror any changes to fields also contained in the meta/intersection table from the parent on save.  We want to use the same webform for most of the service types, and this works fine if I manually bind the data over (manually put the data into the control and manually read it on saves, but if I try setting the business object properties at runtime they don't seem to work.  I can work with this ok, but I would prefer to let the framework do all the work rather than me.  It would be far easier if I could just set the properties on initial load of the form and let everything else happen automagically.  Is this possible?  And if so, what am I likely to be doing wrong?

PS: some portions of the form we add controls to dynamically, so that depending on the parent organization and the service category the overview part of the form is standardized, but the detail portion is defined within the system.  This part is working fine, it's just the dynamic binding I seem to be having trouble with.

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