
Classes | |
| class | DefaultQueryValidationDelegate |
| interface | ErrorKeys |
| interface | ValidationKeys |
Public Member Functions | |
| D2WContext | d2wContext () |
| boolean | hasValidationDefinitionForKey (String key) |
| void | validateNumericValueForKey (Number value, String key) throws NSValidation.ValidationException |
| void | validateQuery (ERD2WQueryPage sender) |
| abstract void | validateQueryValues (ERD2WQueryPage sender) |
| void | validateStringValueForKey (String value, String key) throws NSValidation.ValidationException |
Protected Member Functions | |
| String | propertyKeyFromDisplayGroupKey (String key) |
Protected Attributes | |
| D2WContext | d2wContext |
To disallow a query with no user inputs, create a rule like:
entity.name = 'Foo' => allowsEmptyQueryValue = "false" (BooleanAssignment)
To define a validation for a propertyKey, create a rule like:
entity.name = 'Foo' and propertyKey = 'bar' => allowsEmptyQueryValue = "false" (BooleanAssignment)
To define a minimum length validation for a (String) propertyKey, create a rule like:
entity.name = 'Foo' and propertyKey = 'bar' => minimumInputLength = "3" (Assignment)
Subclasses wishing to implement custom validation logic should implement the validateQueryValues method. The implementation should catch validation exceptions and invoke er.directtoweb.pages.ERD2WPage#validationFailedWithException(Throwable, Object, String) with any caught exceptions. To customize behavior, while retaining the default checks, extend ERDQueryValidationDelegate.DefaultQueryValidationDelegate to perform custom validations and then call validateQueryValues on the superclass.
| D2WContext d2wContext | ( | ) |
Gets the D2WContext against which the validation definitions will be evaluated. from
| boolean hasValidationDefinitionForKey | ( | String | key | ) |
Determines if the D2W context contains a validation definition for the provided {
| key | to check |
Gets the D2W property key corresponding to the display group key by matching the key with one in the D2W context's displayPropertyKeys.
| key | from the display group |
| void validateNumericValueForKey | ( | Number | value, | |
| String | key | |||
| ) | throws NSValidation.ValidationException |
Validates a string value, checking minimumInputValue and maximumInputValue.
| value | to validate | |
| key | of the property to validate |
| NSValidation.ValidationException | when the validation fails |
| void validateQuery | ( | ERD2WQueryPage | sender | ) |
Validates the query inputs before executing the query.
| sender | query page whose inputs to validate |
| abstract void validateQueryValues | ( | ERD2WQueryPage | sender | ) | [pure virtual] |
Validates the query input values from the query page's display group.
| sender | query page whose inputs to validate |
Implemented in ERDQueryValidationDelegate.DefaultQueryValidationDelegate.
Validates a string value, checking minimumInputLength and maximumInputLength.
| value | to validate | |
| key | of the property to validate |
| NSValidation.ValidationException | when the validation fails |
D2WContext d2wContext [protected] |
1.5.8