-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I am listening on certain CtrlKeys which includes ctrl+a ,the processing of the particular business logic takes 2-10 seconds and in that time i want that no more further requests are queued for that key [or any key that i am listening on -OPTIONAL] and only queue request that after the process completes .
win.setCtrlKeys("#f1#f2#f6#f7#f8#f9#f12#left#right#pgup#pgdn#up#down@b@g@i@k@l@n@o@p@r@s@u^x^a^c^z^1^2^#up^#down");
win.addEventListener("onCtrlKey", keylistener);
keylistener here is my event that implements business logic to cater all the keys mapped and pressed.What currently happens is the keys pressed multiple times in the meantime are queued and add to multiple request sent to server which at times lead to chaos .Is it possible in ZKOSS ,or any workarounds?
I suggest removing or disabling your eventhandler for the keys in the first place.
After that, you echo an event that will trigger the effective business logic.
The reason for echoing is that the disabling key's will be propagated to the client before beginning the business logic. When the bussines logic is done, you can enable or add the eventlistener for the keys again.
Greetz chill.
Hello Vishaltyagi700,
You could use long operations as shown below:
https://www.zkoss.org/wiki/SmallTalks/2015/January/SimplifyLongOperationHandlings
Best Regards,
Darksu
Asked: 2016-09-15 06:02:23 +0800
Seen: 30 times
Last updated: Sep 18 '16
I suggest disable or remove your eventhandler for Keys. Echo the bussines logic event. After that reenable the key listener
chillworld ( 2016-09-17 05:31:12 +0800 )edit@chillworld Yes,thanks this approach worked in my case.Please post this as an Answer.
Vishaltyagi700 ( 2016-09-17 10:36:25 +0800 )edit