1
votes

I have a problem with invalid textField. I have created this function to help me put some textfield invalid without the (!) bubble.

private void checkTextField(TextField Text){
    Text.setErrorSupport(new TitleErrorHandler(Text));
    Text.forceInvalid("");    
  }

My problem is that now when I try to save my page, I want to ignore that error even if it's still active. The API told me to do this:

public void forceInvalid(java.lang.String msg)

Forces the field to be invalid using the given error message. When using this feature, clearInvalid() must be called to clear the error. Also, no other validation logic will execute.

myText.clearInvalid();

but when I do it and check if the form hasErrors() it return true. is there another way to ignore the errors?

1
So you want to draw an error, but you don't want it to be counted as an error by the field?Colin Alworth
yes, because I cant just put css lie a normal person would, my superior want this.Joel Fontaine-Richard
The field that I put invalid is in readonly, and it is there just to notify the user that there is a difference between what he wrote and what there is in the database.Joel Fontaine-Richard

1 Answers

0
votes

Try markInvalid() It will display Error Message but not prevent you submitting the page Info.

private void checkTextField(TextField Text){

Text.setErrorSupport(new TitleErrorHandler(Text));

Text.markInvalid("<Your Error Message>");    

}