I want to implement digital signature method:
1,press button to call java logic in server which caculate the whole datas
2,call the Java script in client which get the digital signature
3,store the result into database in server.

Of course it has no return value, this method will just add this JS to the response of the current execution. The JS will be rendered and executed at the client side.

I just adapted the example from above and added the remaining steps:
see here

As you can see the result of the doClientSignature function is passed to the server in a separate command "storeToDB"

Also check the network tab in firebug or in chrome developer tools... you'll see that 2 ajax requests are made to the server. One with the onClick event, and the second with the custom onStore event. The server translates these events into the appropriate commands defined in the MVVM command bindings.

as far as I know ZK has no server side synchronous JS call mechanism to retrieve the result directly. ZK uses Events to communicate with the client, so you always have to listen on an event and use the data attributs for payloads containing the responses.

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)!