-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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.
Hello psinalberth,
This may work for you in order to create a custom message:
https://www.zkoss.org/wiki/ZKDeveloper'sReference/UIPatterns/UsefulJava_Utilities#showNotification
Best Regards,
Darksu
You may use Clients.wrongValue method like this
public abstract class NotificationValidator implements Validator {
@Override
public void validate(ValidationContext ctx) {
Component component = ctx.getBindContext().getComponent();
String message = getValidationMessage(ctx);
if (StringUtils.isNotEmpty(message)) {
ctx.setInvalid();
Clients.wrongValue(component, message);
} else {
Clients.clearWrongValue(component);
}
}
protected abstract String getValidationMessage(ValidationContext ctx);
it show validation message the same way as WrongValueException
Asked: 2016-11-07 01:25:45 +0800
Seen: 28 times
Last updated: Oct 31 '20
zk mvvm > what's the best component to make LOV (list of value) of a master data [closed]
Databinding and auto-complete on combobox
Composite component and bind in ZK 6
How to detach / reattach MVVM windows?
Is there a way to resolve view model properties as input to client side javascripts?
How can I synchronize data in a ListBox in MVVM ? [closed]
MVVM Validator: class not found ? [closed]
How to Call Child ViewModel Method from Parent Window? [closed]