0

MVVM Clean Validation Messages Holder

asked 2018-12-11 18:59:48 +0800

psinalberth gravatar image psinalberth
52 6

Hi, how could I clean validation messages manually? I have something like:

<div viewModel="@id('vm') @init('ViewModel')" validationMessages="@id('vmsgs')">
</div>

And I'd like to clean all validation messages by clicking a button. Is it possible?

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-02-14 19:26:05 +0800

cor3000 gravatar image cor3000
6280 2 7

Without having tested it, my first idea would be to call ValidationMessages.clearAllMessages() ?

e.g. from a button with a command binding passing in the validation messages object.

<button onClick="@command('clearErrors', vmsgs=vmsgs)" label="clear errors"/>

@Command
public void clearErrors(@BindingParam("vmsgs") ValidationMessages vmsgs) {
    vmsgs.clearAllMessages();
}

Did you already try that, were there any problems?

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

Follow
1 follower

RSS

Stats

Asked: 2018-12-11 18:59:48 +0800

Seen: 13 times

Last updated: Feb 14 '19

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