Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Resolved
-
2.0.0-M3
Description
If I have an action "update" that is validated in it's entirety by a validation method "validateUpdate" then the error message in the wicket viewer shows unwanted boiler plate wording ("[violation of some declarative constraint]:") together with the desired error message.
Screenshot of unwanted text:
Code that produces the message
@Action(semantics = SemanticsOf.NON_IDEMPOTENT) public Task update( TaskStatus status, @Parameter(optionality = Optionality.OPTIONAL) String comment) { this.status = status; if (comment != null) { this.comments = "".concat(this.comments).concat(comment).concat("\n"); } return repositoryService.persist(this); } public String validateUpdate(TaskStatus status, String comment) { if (this.status != status) { if (this.status == TaskStatus.Complete || this.status == TaskStatus.Cancelled) { return "Can't change status of a task that is Complete or Cancelled"; } } return null; }
This problem does not manifest if I do validation on only one of the action parameters, as follows:
Screenshot:
Code of validation message:
public String validate0Update(TaskStatus status) { if (this.status != status) { if (this.status == TaskStatus.Complete || this.status == TaskStatus.Cancelled) { return "Can't change status of a task that is Complete or Cancelled"; } } return null; }