I have List box in new Neon Scout and I would like to validate value that was set.
I have implemented execValidateValue
method :
@Override
protected Set<String> execValidateValue(final Set<String> rawValue) {
if (rawValue.contains(CONSTANT.UNKNOWN)) {
final Set<String> unknownSet = new HashSet<String>();
unknownSet.add(CONSTANT.UNKNOWN);
return super.execValidateValue(unknownSet);
}
return super.execValidateValue(rawValue);
}
but it doesn't seams to have any effect. While debugging I see that inside setValue(VALUE rawValue)
method updateDisplayText(validatedValue)
is called with right list of strings.
Why is that? Is there something that I did wrong?
Marko
You are right... If a value is changed during the validation (in
execValidateValue(VALUE rawValue)
) as suggested by the JavaDoc, the value is stored correctly in the Scout Model but the change is not reflected in the HTML-UI.With the help of Samuel Renold, I have asked the team about it: The HTML-UI will be fixed to reflect the change in the UI. See bug 493778.
Test code for the Demo Widgets Application. Change the
DefaultField
in theListBoxForm
.The wrong behaviour can also be reproduced in Scout 4 (this release is end-of-life)