IBusinessBindable with OnValidate


Author
Message
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Based on the feedback from another post (http://forum.strataframe.net/FindPost13906.aspx) 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?
Replies
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
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?
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
This is a control level issue.  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.  Validation in a textbox is invoked, for example, when you try to leave the field.  So it calls the OnValidating method which raises the Validating event.  This method call is never happening in your control.  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.
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
One other thing.  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.
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
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 Sad
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Greg McGuffey - 17 Years Ago
     Bump....
Greg McGuffey - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Greg McGuffey - 17 Years Ago
Trent L. Taylor - 17 Years Ago
                         One other thing. If you are inherited a control that already has the...
Trent L. Taylor - 17 Years Ago
                             I'll look into this. This is a sub classes TextControl, by...
Greg McGuffey - 17 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search