-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi, I have problem with an applet, sometime users, due to continuos java and brower updates and securety restriction, fail to check security alert and the applet does not load.
When this happen I get an
SEVERE: [Desktop zmd:/authriv/menu.zul] client error: Method not found: findPrinter on log file and a zkoss popup error with "method not found: findPrinter" because the applet class isn't loaded due to some browser or java restriction
I call the applet method on server side in this way: applet.invoke("findPrinter", "HPxxx");
Is there a way to catch this exception in my code ? Is there a way to undestand if the applet class il loaded on server side ?
thank you giuseppe
I dont think that anything in the zk's Applet class will help you to catch it. I have the same problem with an applet that i use for printing and i couldnt find a solution. One hard approach is to call a url with the session id from the applet and inform the server that the applet is loaded and unblock the findPrinter(). I will try if i can intercept ZK's messages first.
Sorry, I did a mistake while testing isMayscript(). It return always False even if the applet is correctly loaded giuseppe
oke, I'll search further. Sorry that I have to ask you to try things but that is that I can't test your code myself. (I delete mine post cause its wrong, maybe you can clean also a little
chillworld ( 2014-01-14 14:41:27 +0800 )editOke I searched a little further. In zk 7.0 (don't know older versions) we have this :
if (applet.isMayscript()){
applet.invoke("findPrinter", "HPxxx");
} else {
//do your code
}
Can you try this?
The applet works fine if do not block it ( user can block applet if press wrong button in security popup ) When apple is blocked, applet class is not loaded and if I try to use a method, like "findPrinter", zk rise an axception. It's correct and I just want to catch this situation and inform user about this problem instead of view zk popup exception For this project I'm using zk 6.0.2 I tried to use zk.xml error page element (http://books.zkoss.org/wiki/ZK%20Configuration%20Reference/zk.xml/The%20error-page%20Element ) but without success
Hi, thank you for you reply I tried to catch the exception server side in the way you show me but the excepion is catched by zk before ( I tried again just few minutes ago ) and never passed to my code
gen 14, 2014 8:17:36 AM org.zkoss.zk.ui.impl.DesktopImpl service:721 SEVERE: [Desktop z_4bu:/authriv/menu.zul] client error: Method not found: findPrinter
oke I'll look in to it. but can you give full stacktrace? and what version (for the correct class of zk
chillworld ( 2014-01-14 07:35:04 +0800 )editYou are sure that you have the method findPrinter and your path to your applet is correct? (this is not really a problem that could work sometimes and sometimes not)
chillworld ( 2014-01-14 07:41:03 +0800 )editAsked: 2014-01-13 17:52:49 +0800
Seen: 22 times
Last updated: Jan 16 '14