Skip to main content

I created a control LookupListItemPicker, who inherited from EntityEditorWithPicker. Next, I created a custom control LookupControl, who inherited from BaseBindableFormControl. Next, try to add validation of input values in a lookup field. How can I do it?

validation for what?  Number?  Text?  the value itself?

Can you use a hidden field computed from the field you are wanting to validate and validate it?


I'm trying to make a control array lookup values from a list using the Sharepoint class EntityEditorWithPicker. If I make this control and use in Sharepoint, it works correctly, once I transfer the code to the control Nintex, the validation is not working. Below is an example in which I record the CustomValidation:

 protected override void CreateValidationControls()
{
if (this.LookupProperties.IsRequired)
{
RequiredFieldValidator requiredFieldValidator = new RequiredFieldValidator();
requiredFieldValidator.ID = "requiredFieldValidator";
requiredFieldValidator.ControlToValidate = this.AssociatedControlForLabel.UniqueID;
requiredFieldValidator.ErrorMessage = string.IsNullOrEmpty(this.LookupProperties.RequiredErrorMessage) ? string.Empty : this.LookupProperties.RequiredErrorMessage;
this.RequiredFieldValidator = (BaseValidator)requiredFieldValidator;
this.ApplyCommonValidatorSettings(this.RequiredFieldValidator);
this._lookupControl.Controls.Add((Control)this.RequiredFieldValidator); 

This approach does not work, because the engine ASP.NET can't find the control for which to make the validation. I don't know what I'm doing wrong.

Sorry for my English.


...way beyond me, sorry can't help!!


Reply