-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I'm using zk ce 8.0.2.2. I tried for a few hours to get the client side binding to a command in a viewmodel to work. I tried it out in several different ways in the zul file, at the end just in the java script debbuging console of chromium. I loaded an example to zkfiddle. I tried in several different ways to get it working, but I just needed to chose an example that would work in the fiddle.
http://zkfiddle.org/sample/3lsdr7g/5-zk-client-side-command-binding-test
when you click on the first normal zk button, the command gets called and the label changes its value.
When you click on the second button, which is a html button, with an onclick event, where the command should be called.
zkbind.$('$label').command('testcommand', {test: 'argh'});
But just nothing happens. not even an error message or anything. When I try to do it in the debugging console the command seems to work (no error message or anything), but the command at the server side never gets called.
Could anybody tell me what I'm doing wrong. For me it looks like I'm doing exactly the same as shown in the examples in the documentation.
it took me hours to figure it out. But as it seems the problem is uncomplete documentation. You need to add the annotation "@ToServerCommand({...})" to the viemmodel class. It's neither mentioned in any of the smalltalks, nor in the documentation: http://books.zkoss.org/zk-mvvm-book/8.0/data_binding/client_binding_api.html (http://books.zkoss.org/zk-mvvm-book/8.0/databinding/clientbinding_api.html)
Asked: 2016-12-08 15:50:28 +0800
Seen: 30 times
Last updated: Dec 09 '16
zkspringmvc jar licence is GPL ?
Build web application without any zul files
Custom component that extends Textbox does not fire onChange event
java.lang.NullPointerException to update to zk 8.0.1
"Spring Session" + ZK + "Spring core" @Listen method refresh the screen
upload event dialog do not open in browser
Notification is not shown inside sticky block
Where can I find documentation (like ZK Developer's Reference) for ZK 8.0.2.2 ?