Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ADF Validator problem - ValidatorException not thrown

Peter551059Jun 11 2013 — edited Aug 22 2013

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.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 19 2013
Added on Jun 11 2013
14 comments
4,186 views