public String disableValidation()
{
FacesContext facesContext = FacesContext.getCurrentInstance();
UIInput number1 = (UIInput)facesContext.getViewRoot().findComponent("form1:number1");
Validator[] validators = number1.getValidators();
if (validators != null)
{
for (int i = 0; i < validators.length; i++)
{
Validator validator = validators[i];
number1.removeValidator(validator);
}
}
UIInput number2 = (UIInput)facesContext.getViewRoot().findComponent("form1:number2");
validators = number2.getValidators();
if (validators != null)
{
for (int i = 0; i < validators.length; i++)
{
Validator validator = validators[i];
number2.removeValidator(validator);
}
}
UIInput text = (UIInput)facesContext.getViewRoot().findComponent("form2:text");
validators = text.getValidators();
if (validators != null)
{
for (int i = 0; i < validators.length; i++)
{
Validator validator = validators[i];
text.removeValidator(validator);
}
}
return "ok";
}