MVVM WrongValueException

asked 2016-11-07 01:25:45 +0800

psinalberth gravatar image psinalberth
52 6

I can use getBinder().getView() as argument for WrongValueException(Component c, String message) to show validation messages on a zul by throwing WrongValuesException. Does MVVM approach have something like that using no wire components? I've seen some examples using modal window and vmsgs, pointing each "property" on zul but I'd like to show validation messages just like default MVC: top-left-corner, appending all messages.

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted

answered 2016-11-07 09:17:27 +0800

Darksu gravatar image Darksu
1991 1 4

Hello psinalberth,

This may work for you in order to create a custom message:


Best Regards,


link publish delete flag offensive edit

answered 2020-10-31 01:58:03 +0800

Arsen gravatar image Arsen
382 5

You may use Clients.wrongValue method like this

public abstract class NotificationValidator implements Validator {

  public void validate(ValidationContext ctx) {
    Component component = ctx.getBindContext().getComponent();
    String message = getValidationMessage(ctx);
    if (StringUtils.isNotEmpty(message)) {
      Clients.wrongValue(component, message);
    } else {

  protected abstract String getValidationMessage(ValidationContext ctx);

it show validation message the same way as WrongValueException

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

1 follower



Asked: 2016-11-07 01:25:45 +0800

Seen: 28 times

Last updated: Oct 31 '20

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More