[ 
https://issues.apache.org/jira/browse/ISIS-2419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17171444#comment-17171444
 ] 

ASF subversion and git services commented on ISIS-2419:
-------------------------------------------------------

Commit 8457eb934baec5ee2be63299abaa52bb3fff33d9 in isis's branch 
refs/heads/master from Andi Huber
[ https://gitbox.apache.org/repos/asf?p=isis.git;h=8457eb9 ]

ISIS-2419: for a consistent user experience with action dialog
validation messages, be less verbose (suppress the category) if its a
Category.CONSTRAINT_VIOLATION

> Less verbose Action Dialog Validation Feedback, if its (just) a Constraint 
> Violation (suppress Category)
> --------------------------------------------------------------------------------------------------------
>
>                 Key: ISIS-2419
>                 URL: https://issues.apache.org/jira/browse/ISIS-2419
>             Project: Isis
>          Issue Type: Improvement
>          Components: Isis Viewer Wicket
>    Affects Versions: 2.0.0-M3
>            Reporter: Simon Titheridge
>            Assignee: Andi Huber
>            Priority: Minor
>              Labels: newbie
>             Fix For: 2.0.0-M4
>
>         Attachments: image-2020-08-05-22-26-25-207.png, 
> image-2020-08-05-22-29-10-621.png
>
>
> 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:*
> !image-2020-08-05-22-26-25-207.png|width=516,height=332!
> *Code that produces the message*
> {code:java}
>       @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;
>       }
> {code}
> This problem does not manifest if I do validation on only one of the action 
> parameters, as follows:
> *Screenshot:*
> *!image-2020-08-05-22-29-10-621.png|width=627,height=358!*
> *Code of validation message:*
>  
> {code:java}
>       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;
>       }
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to