buildInValidationBypassMode issue

Posts   
 
    
Posts: 93
Joined: 13-Feb-2008
# Posted on: 27-Feb-2008 15:08:24   

"buildInValidationBypassMode" seems to have no effect on whether the buid-in validation occurs. I'm using DI and have verified that my custom validator class is being inserted and the validation overrides are being invoked.

Scenario: I have a text box bound to a non-nullable int property, I set "buildInValidationBypassMode" to 1 (bypass when validator is present) and the build in validation is still being called when "blanking" out the text box. Essentially my custom validation code will only run if it passes build-in validation regardless of the "buildInValidationBypassMode" setting in the app.config.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 27-Feb-2008 15:27:20   

What makes you say that the built-in validation has been invoked? If you are using windows forms and you can't tab out of the text box, then please check out this link: why-can-t-i-tab-out-of-my-control-when-using-data-binding

Which LLBLGen Pro runtime library version are you using?

I set "buildInValidationBypassMode" to 1 (bypass when validator is present)

By the way 1 = alwaysByPass: The values 0, 1 or 2 for resp. NoBypass, AlwaysBypass or BypassWhenValidatorPresent

Posts: 93
Joined: 13-Feb-2008
# Posted on: 27-Feb-2008 15:56:01   

I assume that build-in validation is being invoked because the field is being validated* and my validator override "ValidateFieldValue" is not being executed. It appears to be a null reference exception being thrown when the binding source is attempting to set the non-nullable int property to "null". I assumed that if I set the "buildInValidationBypassMode" to 1 or 2 that my "ValidateFieldValue" would be called before the entity would attempt to set the value.

  • validated here means that the error provider displays an exception message

LLBLGen 2.5 Adapter Templates .NET 3.5

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 27-Feb-2008 16:39:02   

Which LLBLGen Pro runtime library version are you using?

Please answer the above question using information from the following thread: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=7717

Posts: 93
Joined: 13-Feb-2008
# Posted on: 27-Feb-2008 16:48:11   

File Version: 2.5.08.0122

Thanks for making me look into this, I just realized I haven't replaced that dll in source control since moving from the demo to the licensed product.

Edit: Upgrading to 2.5.08.0214 produces the same result

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 28-Feb-2008 10:08:39   

Are you using a BindingSource?

Would you please place a breakpoint in the setter of the property and see if the call to the setter of the property is ever made. If not then LLBLGen Pro code isn't called at all.

Posts: 93
Joined: 13-Feb-2008
# Posted on: 28-Feb-2008 13:53:09   

I should have thought of that, I guess thats what I get for making assumptions based on how I think windows components should behave...

Setter is not called when the textbox is cleared, which doesn't make any sense at all to me. I guess the BindingSource is doing a preliminary check on the type before attempting to write the value to the object...but who asked it to. simple_smile

I guess I have a lot to learn about windows forms and databinding...Thanks for you patience and your help.