-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello, on project I migrated from ZK5 to ZK8 and I found strange behaviour of Executions.deactivate(desktop) method.
I am using:
zul - 8.0.11
zkplus - 8.0.11
zkbind - 8.0.111
zk - 8.0.11
How my functionality works:
My problem is, that after all calculations are done showBusy window still active. I cannot clear it. Why my suggestion that something wrong with ZK, because I have not change anything in my code. And with ZK5 it still works perfect.
Please refer to classes where I am using it.
ReassignCommand.java raw.githubusercontent.com/LibrePlan/libreplan/6498e85928a8709d451a0d51e760a4d937c56af1/libreplan-webapp/src/main/java/org/libreplan/web/planner/reassign/ReassignCommand.java
LongOperationFeedback.java raw.githubusercontent.com/LibrePlan/libreplan/0600192f1261d5ebdde35a585329d7bcff5ebf4f/ganttzk/src/main/java/org/zkoss/ganttz/util/LongOperationFeedback.java
Note:
As I said, I cannot clear this showBusy method.
private IDesktopUpdate busyEnd() {
return new IDesktopUpdate() {
@Override
public void doUpdate() {
Clients.showBusy("");
}
};
}
"Infinite showBusy" will appear after deactivate method:
@Override
public void run() {
List<T> batch = new ArrayList<T>();
while (true) {
batch.clear();
EndOrValue<T> current = null;
try {
current = queue.take();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
if (current.isEnd()) {
return;
}
if (!desktop.isAlive() || !desktop.isServerPushEnabled()) {
return;
}
try {
Executions.activate(desktop);
} catch (Exception e) {
LOG.error("unable to access desktop", e);
throw new RuntimeException(e);
}
try {
original.doUpdate(current.getValue());
while ((current = queue.poll()) != null) {
if (current.isEnd()) {
break;
}
batch.add(current.getValue());
original.doUpdate(current.getValue());
}
} finally {
Executions.deactivate(desktop);
}
if (current != null && current.isEnd()) {
return;
}
}
}
Image: s32.postimg.org/617fpuwqd/20160712_120520.jpg
Hi Dgray,
Since I can't run your example it's hard to tell what is wrong. Can you share a simple case showing the same problem?
My blind guess would be that Clients.clearBusy() is not called. I'd put a breakpoint into the method that's supposed to call it to check if it is ever reached. If it is called then check the ajax response if it contains the clear busy command.
Other problems could be unrelated JS errors stopping the serverpush or the client engine. Please verify your browser console for any error.
Robert
Thanks for the feedback, your thoughts pushed me to check everything from scratch.
And I found a problem:
Let`s back in time and see what ZK5 offers:
Clients.java
public static final void showBusy(String msg, boolean open) {
if (open) showBusy(msg);
else clearBusy();
}
App code was:
Clients.showBusy(null, false);
Now let`s look at ZK8 Clients.java:
public static final void showBusy(String msg) {
response(new AuShowBusy(msg));
}
So, you deleted built-in clerBusy() method. So it was my bad, that I had not read source code more accurate.
In the end, how it was:
private IDesktopUpdate busyEnd() {
return new IDesktopUpdate() {
@Override
public void doUpdate() {
Clients.showBusy("");
}
};
}
correct code:
private IDesktopUpdate busyEnd() {
return new IDesktopUpdate() {
@Override
public void doUpdate() {
Clients.clearBusy();
}
};
}
Asked: 2016-07-12 09:13:13 +0800
Seen: 44 times
Last updated: Jul 27 '16
How to control selectAll() feature in a Listbox with multiple=true and checkmark=true
ZK8 Wizard Series: Part 2 now released!
Faster And Lighter, The Performance Test On ZK8
org.zkoss.xel.XelException: Resource not found: http://www.zkoss.org/dsp/web/core
How To Check Dirty Status in ZK8?
Come and join the ''JS'' Hunt!
here some common guidelines on how to provide verifyable code examples http://stackoverflow.com/help/mcve
cor3000 ( 2016-07-27 08:15:51 +0800 )edit