0

Activate javascript library?

asked 2009-04-18 00:10:19 +0000

mskosan gravatar image mskosan
15

How can I change the HTML codes generated by ZK? I need to call a javascript function in the body tag to activate a javascript library that I am using, i.e. I need ZK to generate the following: <body onload="initPageObjects();">.

My complete zul code is as follows:

<?link rel="stylesheet" type="text/css" href="../js-graph-it.css"?>
<zk>
<script type="text/javascript" src="../js-graph-it.js"></script>
<html>
<attribute name="content"><![CDATA[
<style>
.block { position: absolute; }
</style>
<div class="canvas" id="mainCanvas"
style="width: 350px; height: 250px; border: 1px solid black;">
<h1 class="block draggable" id="h1_block"
style="left: 10px; top: 10px;">
h1 block
</h1>
<h2 class="block draggable" id="h2_block"
style="left: 200px; top: 100px;">
h2 block
</h2>
<div class="connector h1_block h2_block"></div>
</div>
]]>
</attribute>
</html>
</zk>

The HTML generated by ZK is as follows:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
<title></title>

<link rel="stylesheet" type="text/css" href="/cdm/zkau/web/zul/css/normie.css.dsp"/>
<link rel="stylesheet" type="text/css" href="/cdm/zkau/web/js/ext/timeplot/api/styles/timeplot-bundle.css"/>
<link rel="stylesheet" type="text/css" href="/cdm/zkau/web/zkex/zul/css/zkexie.css.dsp"/>
<link rel="stylesheet" type="text/css" href="/cdm/zkau/web/zkmax/zul/css/zkmaxie.css.dsp"/>


<script type="text/javascript" src="/cdm/zkau/web/js/zk/zk.js.dsp" charset="UTF-8">
</script>
<script type="text/javascript">
zk_ver='3.6.0';
zk.build='09030311';
zk_procto=900;
zk_tipto=800;
zk_resndto=-1;
zk_clkflto=0;
zk.eru={};

zk.mods["timelinez.timeline"]="1.2_1";
zk.mods["gmapsz.gmaps"]="2.0_10";
zk.mods["fckez.fckez"]="2.6.1_1";
zk.mods["timeplotz.timeplot"]="1.0_2";
zk.mods["atticz.attic"]="1.070426.009";
</script>


<link rel="stylesheet" type="text/css" href="../js-graph-it.css"/>

</head>
<body>

<div class="zk" id="z_fd_0" z.dtid="gfd91" style="width:100%;height:100%;" z.zidsp="page" z.au="/cdm/zkau">

<script id="z_fd_1" type="text/javascript" src="/cdm/../js-graph-it.js">
</script>
<span id="z_fd_2">
<style>
.block { position: absolute; }
</style>
<div class="canvas" id="mainCanvas"
style="width: 350px; height: 250px; border: 1px solid black;">
<h1 class="block draggable" id="h1_block"
style="left: 10px; top: 10px;">
h1 block
</h1>
<h2 class="block draggable" id="h2_block"
style="left: 200px; top: 100px;">
h2 block
</h2>
<div class="connector h1_block h2_block"></div>
</div>

</span>
</div>

<noscript><div class="noscript"><p>Sorry, JavaScript must be enabled.<br/>Change your browser options, then <a href="">try again</a>.</p></div></noscript>

</body>
</html>

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2009-04-23 03:00:01 +0000

henrichen gravatar image henrichen
3869 2
ZK Team

Consider calling Clients.evalJavaScript() in onCreate event of your outter most component.

Or you will have to read the Component Developer's Guide.

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: 2009-04-18 00:10:19 +0000

Seen: 831 times

Last updated: Apr 23 '09

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