-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello All ,
I am trying to use session time out management in a ZK web application. So I used the automatic time-out function from Zk with a time duration of some minutes. Now I want a view this countdown timer in my webapplication (for example showing it in this way HH:MM:SS).So Please help me, if there are any methods to solve this directly using ZK timeout functions.
Thanks and Regards
Also: a simpler approach using script and auto-timeout. Need auto-timeout activated (page level or app level) to calculate the timeout http://zkfiddle.org/sample/85cq6/6-zk-timeout-simplified
Hi giriprasadkota,
You will find a rough example of the type of structure which could be used in this scenario here: http://zkfiddle.org/sample/2c3rpsn/13-ZK-session-expiration-warning
It uses ${session.maxInactiveInterval} in zul to obtain the session timeout information, then use it to compare the current time with the expiration time on client side. It then run an interval every seconds to update the expiration clock. (in this case, a simple label component which is located by ID).
Depending on your application structure, you can improve on this first step by improving the clock UI (using a more visual clock, inserting it in a specific location of your page,...), using a globally distributed listener in zk.xml instead of the page initiator, etc. These decisions depends on your page and project structure.
Have a look ;)
Asked: 2017-08-01 10:39:27 +0800
Seen: 28 times
Last updated: Aug 03 '17
Dear Duchemin, Thanks for the solution. I tried to do the same thing as mentioned in the example by activating the auto time out in my zk.xml file. But In my server i am not able to calculate the count down time. I am getting the default NaN:NaN:NaN instead of counting the timer. Please help me
giriprasadkota ( 2017-08-03 09:17:28 +0800 )edit