-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi all,
Since I can't find appropriate chart ui in zk chart, I want to make a chart ui myself. I use html svg to achieve it. Then I want to use server push to push data to client, and then svg would show the latest infomation.
My is as below. AuResponse is used to send current temperature value to client and then svg ui show it. Api doc tells that Executions.activate(desktop) would pause current thread until the page is ready or other condition... So when I browsed this page, controller would execute to this line and paused. My question is that how to break thread pause and let it continue execute.
Thanks
-------------Controller------------ Executions.activate(desktop); . . AuResponse response = new AuResponse("temperature", new Object[]{val}); Clients.response(response); . . Executions.deactivate(desktop);
------------Client------------ <zk xmlns:n="native"> <window title="new page title" border="normal" apply="com.gemtek.au.ClientSideHandler">
<script defer="true"> zAu.cmd0.temperature = function (val) { zk("#tempUI").animate({'height',100-val},1000); zAu.send(new zk.Event(zk("#tempUI"), "onFoo", {foo: 'my data'}, {toServer:true})); }; </script><n:svg viewbox="0 0 145 145">
<n:rect x="30" y="25" width="30" height="100" fill="#1565c0"/>
<n:rect x="30" y="25" width="30" height="0" fill="#edebeb" id="tempUI"/>
</n:svg>
</window>
</zk>
Asked: 2016-10-07 01:20:07 +0800
Seen: 18 times
Last updated: Oct 07 '16