Using IntegerRangeValidator
Posted: Thu Nov 01, 2012 12:10 pm
I have an entity that contains a percent value, and I'd like to constrain and validate this field when entered into the admin app so that only 0 to 100 can be entered. I've created my own modules, presenters, etc... which all seems to work fine - but I can't get the IntegerRangeValidator (or FloatRangeValidator) to have any effect.
I've effectively used the com.smartgwt.client.widgets.form.validator.RegExpValidator elsewhere so was expecting the range validator to work too.
I have this in my entity class:
Any thoughts on where I may be going wrong? Are there any examples in the Broadleaf codebase or anywhere else that might guide me?
I've effectively used the com.smartgwt.client.widgets.form.validator.RegExpValidator elsewhere so was expecting the range validator to work too.
I have this in my entity class:
Code: Select all
@Column(name = "PERCENT")
@AdminPresentation(friendlyName = "Percentage (%)",
validationConfigurations = { @ValidationConfiguration(validationImplementation = "com.smartgwt.client.widgets.form.validator.IntegerRangeValidator",
configurationItems = {
@ConfigurationItem(itemName = "min", itemValue = "0"),
@ConfigurationItem(itemName = "max", itemValue = "100")
})
})
protected int percent;
Any thoughts on where I may be going wrong? Are there any examples in the Broadleaf codebase or anywhere else that might guide me?