Hello,
I'm using the latest demo version (2.5 Final Demo) with .NET 3.5, template: SelfServicing.TwoClasses 2008.
I'm (still) evaluating LLBLGen pro: I like it a lot. I am using LLBLGen's build in validation mechanism, which turns out to be quite easy and productive. There's just one thing that bothers me:
I have a mandatory (NOT NULL) field called Name, on an Entity (customer). I have a textbox's Text property bound to an entity's Name property. I set the binding to "OnPropertyChanged", for instant feedback. When the form is displayed with a new entity, the controls start out empty. You can then type a name.
IF the entity Name property contains a value, and you clear the name, the validation class rejects the value (returns false) and the error provider blinks with it's icon. This is exactly the behavior we want. Now there's just one flaw in this system: When the validation rejects the value, the property of the entity remains unchanged (the last value of the entity remains). Somehow, the control is notified of a propertychange (we think), since this last value is also restored to the textbox.
For example: if I type a T (into an empty field) and then press backspace again to remove it, the T is restored and the icon blinks. This means the icon indicates an error, but the text has been restored so there IS no error.
If we change the field validation to return true (so it accepts the empty value) but still set the field error, no error message is shown.
I looked at the LLBLGen pro example (LLBLGenPro - Validation Example - Selfservicing: The Customer's section). You use databinding too, and you achieve the effect we desire (plus, your validation function DOES return false, so the property on the entity is set!).
I was wondering what I'm doing wrong here? Changing the updatemode to OnValidation doesn't matter: if you empty the Name field and then tab to another, the value is also restored (and the error icon shows up again).
Just to point out some of the differences between my setup and the example:
- I'm not using a EntityCollection or a binding source: I bind the controls directly to the entity
Kind regards,
Jeroen.