-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I want to use @save like this:
<div form="@id('fx') @load(vm.data) @save(vm.data, before='doSave')">
where doSave is a method in the same vm but it has been annotated as a global-command.
According to the data binding documentation for @save:
Command name must correspond to the name specified in Java annotation @Command in a ViewModel.
Is there any way I can use a global-command for the same purpose ? The same code with @command works, however if I sue @Globalcommand it doesn't. The button for saving the entity is not in the same page as the form, and I have to trigger that through a global-command in order to call that method. It is in the same VM though.
I think you can try this code ...
Binder bind = (Binder) view.getParent().getAttribute("binder");
if (bind == null)
return;
bind.postCommand("Your GlobalCommand Name", params);
Asked: 2013-05-29 13:59:13 +0800
Seen: 18 times
Last updated: May 29 '13
How to get the absolute path of attached file
Editable interface to add users
how can i get data from another page
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
@sjoshi Where would I use that code ?
I can call the global-command fine from the other page, the problem is that @save doesn't capture the event and the entity vm.data will therefore have no changes.
bluegod ( 2013-05-29 14:40:15 +0800 )edit