Hi,
I found validator functionality completely unusable.
Using JD Studio Edition Version 11.1.1.5.0 on Weblogic 11.1.1.5
I have JSFF with popup (modal dialog) inside to insert new record.
To validate RichInputText to insert only digits I created validator in backing bean.
public void newPeriodValidator(FacesContext facesContext, UIComponent uIComponent, Object newValue) { |
| Pattern digitPattern = Pattern.compile("\\d{8}"); |
| if (!digitPattern.matcher(newValue.toString()).matches()) { |
| FacesMessage fm = new FacesMessage("You must insert 8 digits"); |
| fm.setSeverity(FacesMessage.SEVERITY_ERROR); |
|
| facesContext.addMessage(uIComponent.getClientId(facesContext), fm); |
| throw new ValidatorException(fm); |
| } |
| } |
When I insert incorrect value and leave field by TAB key, field is higlighted as invalid but no error message is shown. OK button can be pushed but commit method is not fired.
What I do wrong? I cannot find any useful help. Only difference between my code and tutorials is that my code doesn't work.