-
1. Re: BeanValidation fired each time an ajax request
nbelaevski Aug 24, 2010 2:40 PM (in response to jobb)Hi Mirek,
You can set immediate="true" for tab panel, so that it will switch with any validation result, however this will block updating the property with new value. Better alternative is switching to 'client' mode.
-
2. Re: BeanValidation fired each time an ajax request
jobb Aug 25, 2010 2:31 AM (in response to nbelaevski)Hi Nick,
You have right, in this case, but normally you need to interact with bean (read switchType !="client") to perform some action when a user change tabs, but it is not what is important in this case !
What I want is to get control on validation on my own and trigger validation when its necessary.
I tried with around inputText to limit updates to region only, tried but steel the same behavior is recorded.
I had to "manually" perform validation, removing tags from the page and placing code like this on actionListener code in the bean for submit button :
private Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
public void sjekkFodselsnrOgSok(){
Set> constraintViolations = validator.validate(fnrSjekk);
int antallValideringsFeil = constraintViolations.size();
if(antallValideringsFeil > 0){...}
... }
Is there any way to use <rich:???Validation> tags and control validation on form submitting ?
-
3. Re: BeanValidation fired each time an ajax request
ilya_shaikovsky Aug 25, 2010 2:42 AM (in response to jobb)if you want to switch tabs via ajax without validation and perform validations/model updates only on clicking links/buttons - just remove form around the tabPanel and insert separate forms to every tabs.