nl.gx.webmanager.handler.forms.validation
Class CountDbValidator
java.lang.Object
nl.gx.webmanager.handler.forms.foundation.FormHandlerBase
nl.gx.webmanager.handler.forms.validation.CountDbValidator
- All Implemented Interfaces:
- FormComponent, Validator
public class CountDbValidator
- extends FormHandlerBase
- implements Validator
Validator for checking the number of occurrences of values in a database.
| Parameter name |
Mode |
Default value |
Description |
| wmformpart |
Required |
- |
The formpart to validate |
| messageformpart |
Optional |
- |
The formpart where the validation message should be displayed. If there is no messageformpart,
the message is displayed on the form instead of a formpart. |
| countquery |
Required |
- |
Select statement. The number of results in the resultset will be validated |
| connectionname |
Required |
- |
Name of the db connection |
| minimumcount |
Optional |
- |
|
| maximumcount |
Optional |
- |
|
| not_found |
Optional |
- |
Message that is returned if the wmformpart value does not validate |
Returned validator message(s):
|
Field Summary |
static java.lang.String |
NOT_FOUND
|
|
Method Summary |
void |
init(FormComponentConfig c)
Passes the initialization parameters to the component. |
ValidatorMessage[] |
validate(FormDefinition form,
State formState,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Performs validation on a form and returns an array of validator
messages, containing errors detected in the submitted values. |
| Methods inherited from class nl.gx.webmanager.handler.forms.foundation.FormHandlerBase |
close, close, close, executeInsertWithIdentityMSSQLMYSQL, executeInsertWithIdentityOracle, executeIntegerQuery, executeIntegerQuery, executeIntegersQuery, executeIntegersQuery, executeQuery, executeStringQuery, executeUpdate, fillValues, getDataSource, setArguments, setArguments |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NOT_FOUND
public static final java.lang.String NOT_FOUND
- See Also:
- Constant Field Values
CountDbValidator
public CountDbValidator()
init
public void init(FormComponentConfig c)
throws InitializationException
- Description copied from interface:
FormComponent
- Passes the initialization parameters to the component.
- Specified by:
init in interface FormComponent
- Parameters:
c - The FormComponentConfig object that contains
configutation information for this component.
- Throws:
InitializationException - If initialization failed
validate
public ValidatorMessage[] validate(FormDefinition form,
State formState,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
- Description copied from interface:
Validator
- Performs validation on a form and returns an array of validator
messages, containing errors detected in the submitted values.
- Specified by:
validate in interface Validator
- Parameters:
form - The form that should be validatedformState - The object representing the state of the formflow.
This object provides access to values submitted by the client and
the exceptions and validator messages for the form.req - The http servlet requestres - The http servlet response
- Returns:
- The array of validator messages, containing validation errors for the form.
Copyright © 2007-2011 GX Software BV. All Rights Reserved.