Uploaded image for project: 'Isis'
  1. Isis
  2. ISIS-2419

Less verbose Action Dialog Validation Feedback, if its (just) a Constraint Violation (suppress Category)

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Resolved
    • Affects Version/s: 2.0.0-M3
    • Fix Version/s: 2.0.0-M4
    • Component/s: Isis Viewer Wicket
    • Labels:

      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;
      	}
      

       

        Attachments

        1. image-2020-08-05-22-26-25-207.png
          56 kB
          Simon Titheridge
        2. image-2020-08-05-22-29-10-621.png
          46 kB
          Simon Titheridge

          Activity

            People

            • Assignee:
              hobrom Andi Huber
              Reporter:
              stitheridge Simon Titheridge
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: