0

ZK 7.0.3 Execution.createcomponents updating screen

asked 2015-04-13 14:50:18 +0800

danielgoodwin gravatar image danielgoodwin
76 2

ZK 7.0.3

I have a requirement where a 'normal' java class calls Executions.createComponents, and the 'normal' class then does a blocking operation . My problem is that the 'result' of the createComponents does not appear on the screen until AFTER the blocking operation is complete or times out.

I have added problem that I the Executions.wait(_mutex); errors unless I have disable-event-thread set to false (and this is deprecated in 7.0.3) (error is This method can be called only in an event listener, not in paging loading)

Any hints appreciated.


private final Object _mutex = new Integer(0);
..

final Desktop desktop = Executions.getCurrent().getDesktop();
desktop.enableServerPush(true);
Executions.schedule(desktop,
new EventListener() {
@Override public void onEvent(org.zkoss.zk.ui.event.Event arg0) throws Exception { System.out.println("start schedule.."); Executions.createComponents("simple.zul", mainPanel, map); System.out.println("end schedule.."); Executions.notify(_mutex); } }, new org.zkoss.zk.ui.event.Event("onEvent", null, null)); try { System.out.println("Wait .."); Executions.wait(_mutex); System.out.println("Wait ended .."); } catch (SuspendNotAllowedException | InterruptedException e) { e.printStackTrace(); } // SOME _BLOCKING _ OPERATION CODE //
delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-04-13 15:07:08 +0800

chillworld gravatar image chillworld flag of Belgium
5322 4 9
https://github.com/chillw...

This is the way you should do it :

  1. Executions.createComponents
  2. Events.echoEvent
  3. Do the long operation.

It's almost the same as described here, just in stead of doing only Clients.showBusy you do also the createComponents

link publish delete flag offensive edit
Your answer
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)!

[hide preview]

Question tools

Follow
2 followers

RSS

Stats

Asked: 2015-04-13 14:50:18 +0800

Seen: 14 times

Last updated: Apr 13 '15

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More