If you want to add your own error object anytime through the Java API, just instantiate an UserError object and add it to the ErrorController. Be sure you also implement the inverse action to remove the error again.
Image Removed
Hinweis |
---|
See class com.jaxfront.demo.api.AddUserError |
Codeblock |
---|
theme | Eclipse |
---|
language | java |
---|
linenumbers | true |
---|
|
public class AddUserError implements Action { |
...
public void perform(Type target) { |
...
Error myError = new UserError("test-identifier", target, "message",Error.CLASSIFICATION_WARNING); |
...
target.getDOM().getController().getErrorController().addError(myError); |
...
Hinweis |
---|
See class com.jaxfront.demo.api.RemoveUserError |
Codeblock |
---|
theme | Eclipse |
---|
language | java |
---|
linenumbers | true |
---|
|
public class RemoveUserError implements Action { |
...
public void perform(Type target) { |
...
target.getDOM().getController().getErrorController().removeUserError("test-identifier", target); |
...
...