﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » IBusinessBindable with OnValidate</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 03:09:28 GMT</lastBuildDate><ttl>20</ttl><item><title>IBusinessBindable with OnValidate</title><link>http://forum.strataframe.net/FindPost14224.aspx</link><description>Based on the feedback from another post ([url]http://forum.strataframe.net/FindPost13906.aspx[/url]) I was attempting to use OnValidate to update the data source. However, when I set this for a custom control I made, the set property never got fired (the data source was never updated).  I implemented a property change event, but I'm thinking I must need a validate event also.  What do I need to implement on this control to get OnValidate to work?</description><pubDate>Tue, 12 Feb 2008 14:38:15 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: IBusinessBindable with OnValidate</title><link>http://forum.strataframe.net/FindPost14333.aspx</link><description>I'll look into this. This is a sub classes TextControl, by implementing IBusinessBindable. I'll have to see if it has/raises the Validating event.  It should be fun if it doesn't :(</description><pubDate>Tue, 12 Feb 2008 14:38:15 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: IBusinessBindable with OnValidate</title><link>http://forum.strataframe.net/FindPost14330.aspx</link><description>One other thing.&amp;nbsp; If you are inherited a control that already has the OnValidated method, then just call it within your control when you want the control to validate and the binding should follow suit.</description><pubDate>Tue, 12 Feb 2008 13:30:15 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: IBusinessBindable with OnValidate</title><link>http://forum.strataframe.net/FindPost14328.aspx</link><description>This is a control level issue.&amp;nbsp; I am not sure if this is a custom control or not and it also depends on the type of control in which you are inheriting.&amp;nbsp; Validation in a textbox is invoked, for example, when you try to leave the field.&amp;nbsp; So it calls the OnValidating method which raises the Validating event.&amp;nbsp; This method call is never happening in your control.&amp;nbsp; If you are inheriting the UserControl, then you could override the OnValidating and/or the OnValidated method and add your logic to force this to update.</description><pubDate>Tue, 12 Feb 2008 12:53:51 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: IBusinessBindable with OnValidate</title><link>http://forum.strataframe.net/FindPost14326.aspx</link><description>Already done this. Works great....until I change the control to update the data source OnValidate, then the set on the property never gets called, therefore the OnChanged event never gets called, and the field in the BO is never updated.  So the question is, what needs to happen here so I can use the OnValidate to update the BO?</description><pubDate>Tue, 12 Feb 2008 12:15:42 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: IBusinessBindable with OnValidate</title><link>http://forum.strataframe.net/FindPost14324.aspx</link><description>Well, this would depend on the control and property.&amp;nbsp; If you are inheriting a textbox and using the Text property, the you wouldn't have a problem.&amp;nbsp; You will have to fire the changed event of the property, and if one doesn't exists, then you need to create one.&lt;/P&gt;&lt;P&gt;[codesnippet]Public Property MyBindingProperty As String&lt;BR&gt;&amp;nbsp;&amp;nbsp; Get&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return _MyBindingProperty&lt;BR&gt;&amp;nbsp;&amp;nbsp; End Get&lt;BR&gt;&amp;nbsp;&amp;nbsp; Set (Byval value as String)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _MyBindingProperty = value&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OnMyBindingPropertyChanged()&lt;BR&gt;&amp;nbsp;&amp;nbsp; End Set&lt;BR&gt;End Property&lt;/P&gt;&lt;P&gt;&lt;BR&gt;Public Event MyBindingPropertyChanged As EventHandler&lt;/P&gt;&lt;P&gt;&lt;BR&gt;Private Sub OnMyBindingPropertyChanged()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RaiseEvent MyBindingPropertyChanged(Me, EventArgs.Empty)&lt;BR&gt;End Sub[/codesnippet]&lt;/P&gt;&lt;P&gt;This really shouldn't have anything to do with the IBusinessBindable, but rather the .NET binding that goes on behind the scenes one the SF binding creates the Binding class and adds it to the control.&amp;nbsp; So it as though you are just manually binding the control to the property (you would have the same results).</description><pubDate>Tue, 12 Feb 2008 11:54:17 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: IBusinessBindable with OnValidate</title><link>http://forum.strataframe.net/FindPost14322.aspx</link><description>Bump....</description><pubDate>Tue, 12 Feb 2008 10:57:09 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item></channel></rss>