Package com.smartgwt.client.types
Enum ClientUniquenessCheckCondition
java.lang.Object
java.lang.Enum<ClientUniquenessCheckCondition>
com.smartgwt.client.types.ClientUniquenessCheckCondition
- All Implemented Interfaces:
ValueEnum
,Serializable
,Comparable<ClientUniquenessCheckCondition>
,Constable
public enum ClientUniquenessCheckCondition
extends Enum<ClientUniquenessCheckCondition>
implements ValueEnum
For a validator of type
The
isUnique
in a component listing multiple records such as a ListGrid, can we use the
component's fetched data set to check for uniqueness? Used by Validator.checkComponentData
. It is possible to check for uniqueness against a ListGrid's data set and "shortcut" the validation process in a couple of cases:
- If the grid has a complete data set from the DataSource, we can determine whether a record is unique or not by examining that data without ever querying the DataSource.
- Even if the grid is
only displaying a partial data set from the DataSource, if the user-entered value collides with another loaded
record's value, we can assert that the value is not unique.
However, if the data set is not complete we can only shortcut validation when we find a collision. If we don't find a loaded record with a matching value, the DataSource will still need to be queried to definitively determine whether the value is unique.
ResultSet
. Additionally, with the exception of the
special "forceBoth"
setting, component data will only be used to determine uniqueness if the following
conditions are met: - The default fetch operation was used (e.g listGrid.fetchOperation has not been set)
- The data object was automatically created by the component
while fetching data
, as opposed to manually instantiated by the application developer. This is because with a hand-created ResultSet, you could provide any set of records you want, so we don't know if they are an exact match for the default fetch operation on the DataSource.
The
checkComponentData
setting simply allows developers to optimize performance by catching duplicate values on the client before the save
operation is sent to the server, or avoid hitting the server at all during validation without saving
in cases where this is possible.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionIf the component has acomplete data cache
that meets the conditions outlined above, uniqueness checking will be performed against this data set only rather than querying the dataSource to check for uniqueness.If the component has a partial or complete data cache that meets the conditions outlined above, check for another existing record in the cache with an identical field value.[Advanced Setting] As withcheckComponentData:"both"
, if a component has acomplete data cache
, uniqueness checking will be peformed against this data set instead of querying the dataSource.Never consult cached component data. -
Method Summary
Modifier and TypeMethodDescriptiongetValue()
Returns the enum constant of this type with the specified name.static ClientUniquenessCheckCondition[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
NONE
Never consult cached component data. Uniqueness checking will be performed directly against the dataSource data set only.If this enumerated value is used in a
Component XML
file or server-side DataSource descriptor (.ds.xml file), use the value "none". -
EARLYFAILONLY
If the component has a partial or complete data cache that meets the conditions outlined above, check for another existing record in the cache with an identical field value. If one is found, the validator will fail on the client. If no match is found, standard validation will proceed against the dataSource's full data set.If this enumerated value is used in a
Component XML
file or server-side DataSource descriptor (.ds.xml file), use the value "earlyFailOnly". -
BOTH
If the component has acomplete data cache
that meets the conditions outlined above, uniqueness checking will be performed against this data set only rather than querying the dataSource to check for uniqueness.If this enumerated value is used in a
Component XML
file or server-side DataSource descriptor (.ds.xml file), use the value "both". -
FORCEBOTH
[Advanced Setting] As withcheckComponentData:"both"
, if a component has acomplete data cache
, uniqueness checking will be peformed against this data set instead of querying the dataSource. However unlikecheckComponentData:"both"
, the"forceBoth"
setting enables this behavior even if the component's data object has a custom fetch operation specified, or was created explicitly by application code instead of being automatically created as part of the standardfetchData()
flow.If this enumerated value is used in a
Component XML
file or server-side DataSource descriptor (.ds.xml file), use the value "forceBoth".
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getValue
-