First time here? Check out the FAQ!
I need to retrieve command arguments from Validator that is executed before the command (command='doSave', Validator=vm.validator) But I cannot do that. Only validator arguments are available.
zul:
form="@id('fx') @load(vm.form) @save(vm.form, before={'doSave','doSaveAndExit'}) @validator(vm.validator)"
...
View Model:
Map<String, Object> params = new HashMap<String, Object>();
params.put("param", "test value");
binder.sendCommand("doSave", params);
...
View Model:
public Validator getValidator() {
return new AbstractValidator() {
@Override
public void validate(ValidationContext ctx) {
...
BindContextImpl bc = (BindContextImpl) ctx.getBindContext();
Map<String, Object> args = bc.getCommandArgs();
...
}
};
}
After some debugging I found that it is not possible to do because Bind context (BinderImpl.java, lines 1483,1484) that contained command arguments is "lost" and there is another BindContext created instead of it that contains only validator arguments (ValidationHelper.java, lines 262,263).
Can this functionality be added in the future release?
Thanks, Eugene
Asked: 2014-08-01 17:13:46 +0800
Seen: 22 times
Last updated: Aug 01 '14
Create Crud of a User that has a collection of books
Problem binding values to a composite component
How to access static member field of a class in zul without zscript
How can i load a constant in .zul
MVVM Validator: class not found ? [closed]
MVVM tab box - delay @load until tab pane displayed?
mvvm, load or save with after or before for seach command
how to fire an event when a variable value loaded through VM
why you cannot pass parameters you want into the validator directly?
hawk ( 2014-09-26 02:14:21 +0800 )edit