private void notifyFormOfValidityChange() {
Component parentOfSpinnerTextField = getParent();
boolean formFound = false;
while (parentOfSpinnerTextField != null || formFound) {
if (parentOfSpinnerTextField instanceof Form) {
Form f = (Form) parentOfSpinnerTextField;
Collection<?> visibleItemProperties = f.getItemPropertyIds();
for (Object fieldId : visibleItemProperties) {
Field field = f.getField(fieldId);
if (field == this) {
/*
* this SpinnerTextField is logically in a form. Do the
* same thing as form does in its value change listener
* that it registers to all fields.
*/
f.requestRepaint();
formFound = true;
break;
}
}
}