Fix problem in ConstraintChecker
* Previously ConstraintChecker was only working with Textbox and Datebox, now it should work for any InputElement FEA: ItEr75S04BugFixing
This commit is contained in:
parent
97390ce668
commit
71fa130612
1 changed files with 4 additions and 17 deletions
|
|
@ -25,8 +25,6 @@ import java.util.List;
|
|||
|
||||
import org.zkoss.zk.ui.Component;
|
||||
import org.zkoss.zk.ui.WrongValueException;
|
||||
import org.zkoss.zul.Datebox;
|
||||
import org.zkoss.zul.Textbox;
|
||||
import org.zkoss.zul.impl.InputElement;
|
||||
|
||||
/**
|
||||
|
|
@ -50,19 +48,14 @@ public class ConstraintChecker {
|
|||
}
|
||||
|
||||
private static boolean checkIsValid(Component child) {
|
||||
if (child instanceof Textbox) {
|
||||
return textboxIsValid((Textbox) child);
|
||||
}
|
||||
if (child instanceof Datebox) {
|
||||
return dateboxIsValid((Datebox) child);
|
||||
if (child instanceof InputElement) {
|
||||
return inputIsValid((InputElement) child);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static boolean textboxIsValid(Textbox component) {
|
||||
inputElementIsValid((InputElement) component);
|
||||
// Forces constraint to be checked
|
||||
component.getValue();
|
||||
private static boolean inputIsValid(InputElement component) {
|
||||
inputElementIsValid(component);
|
||||
return (component.isValid());
|
||||
}
|
||||
|
||||
|
|
@ -76,10 +69,4 @@ public class ConstraintChecker {
|
|||
}
|
||||
}
|
||||
|
||||
private static boolean dateboxIsValid(Datebox component) {
|
||||
inputElementIsValid((InputElement) component);
|
||||
component.getValue();
|
||||
return (component.isValid());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue