0

onLoad event in ZK

asked 2010-04-13 02:54:59 +0800

vikram gravatar image vikram
18 1 2

hiiii......

i m very new with ZK. i want to know about onLoad event in ZK
in HTML we can use <body Onload="XXX()">
in same way how can i call a function which is written in <zscript>

Please help me ASAP.
Thanks in advance.

delete flag offensive retag edit

5 Replies

Sort by ยป oldest newest

answered 2010-04-13 07:01:24 +0800

xmedeko gravatar image xmedeko
1031 1 16
http://xmedeko.blogspot.c...

ZK 3: http://docs.zkoss.org/wiki/Client_Side_Actions
ZK 5: http://docs.zkoss.org/wiki/ZK5:_Client_Computing_with_ZUML

link publish delete flag offensive edit

answered 2010-04-14 04:34:53 +0800

vikram gravatar image vikram
18 1 2

hi xmedeko........ i ve visited this URL but i m not getting exactly

link publish delete flag offensive edit

answered 2010-04-14 06:41:20 +0800

xmedeko gravatar image xmedeko
1031 1 16
http://xmedeko.blogspot.c...

What about this: http://docs.zkoss.org/wiki/Client_Namespace#Communicate_to_server

link publish delete flag offensive edit

answered 2010-04-14 07:09:33 +0800

vikram gravatar image vikram
18 1 2

I m trying some code what ever u recommended but actually thing is that i want to call server side function from client event.

<zk>
<window contentStyle="background-image : url(image/panel.jpg)">
<html>
<body onload="auth()" onmousemove="timer = start" onclick="timer = start" onkeyup="timer = start" >
</body>
</html>

<script type="text/javascript">
<![CDATA[
var Auth;
function auth()
{
Auth = '${sessionScope.Authentication}';

if(Auth!="admin")
{
window.location = "timeout.zul";
}
else
{
countdown();
}
}

var start = 300;
var timer = start;

function countdown()
{
if(timer > 0)
{

timer -= 1;
setTimeout("countdown()",1000);
}
else
{
location.href="timeout.zul";
}
}

]]>
</script>
//code
<zscript>


</zscript>
</windows>

link publish delete flag offensive edit

answered 2010-04-14 07:16:28 +0800

vikram gravatar image vikram
18 1 2

above code is working properly but their i ve used java script and HTML code.
but i think in java script we cant expire session attributes. so above code redirecting
page after five minutes. but when u ll press browser back button then again same page comes
because session in not expired and i m checking Authentication using session.

Thats y, In same way i want to write code in <zscript> but problem in onLoad event.

i think now u r able to get my requirements so please give me suggestions.

Thanks

link publish delete flag offensive edit
Your reply
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

RSS

Stats

Asked: 2010-04-13 02:54:59 +0800

Seen: 4,013 times

Last updated: Apr 14 '10

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