PDA

View Full Version : TextField.setRegex(...) message



DrogoNevets
26 Nov 2009, 9:10 AM
I have a a TextField that I have set the regex for validation to
this works fine, but how do i state what message is to be returned?

laitinen
26 Nov 2009, 12:44 PM
final TextField<String> textField= new TextField<String>();
textField.setRegex("[0-9]{2}-[0-9]{6}");
textField.getMessages().setRegexText("Must be of this format 12-345678 (with dashes)");