ZK ‘Client-Server’ Communication Sample Part 2

In the first part (link) we made a javascript embedded into our zul page send data to the controller with the magic zau.send() function. The reverse can be done too, call a javascript on the zul page from the controller.

Lets continue with the sample from part 1:

  • Add another javascript to the zul page


        <script type="text/javascript">
            function demoFunction(msg){
  • Implement the caller in the controller
    Controller Class

        public void onClick$btnExec(Event evt) throws InterruptedException {
            Clients.evalJavaScript("demoFunction('some Text');");
  • Redeploy and run the application

    Running Application

One thought on “ZK ‘Client-Server’ Communication Sample Part 2

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s