-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3693846
By: nobody
hi -
i need to include js in my ZUL file. What are the possibilities. I have read some posting here but unfortunately it does not work for me. In my zul file i have tries following:
<h:script src="javascripts/effects.js" type="text/javascript"></h:script>
I put that in the follwing section of zul file:
<window xmlns:h="http://www.w3.org/1999/xhtml" title="ACM 2.0"
border="normal">
<vbox>
<html>
<attribute name="content"><![CDATA[
<head>
<h:script src="javascripts/effects.js" type="text/javascript"></h:script>
</head>
]]></attribute>
</html>
...
It does not work. What am I doing wrong...
Thanks
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3694023
By: henrichen
If you put the javascript in <html> tag then you don't have to specify the h:
namespace. If you mix them with other zul tag then you need to specify that
h: namespace.
<window xmlns:h="http://www.w3.org/1999/xhtml" title="ACM 2.0" border="normal"> <vbox> <html> <attribute name="content"><![CDATA[ <head> <script src="javascripts/effects.js" type="text/javascript"></script> </head> ]]></attribute> </html> ...
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3694453
By: nobody
hi henri,
putting a namespace is optional. but having it there should not stop to work.
i have tried without and it does not work. I checked the page source and saw the following. it has two head section... which is wrong. second one is what i have included in html section. can you please give some more pointers.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<link rel="stylesheet" type="text/css"
href="/acmng-0_0_1/zkau/web/zul/css/normmoz.css.dsp;jsessionid=19A1C8188A1349D00
9077FC1FC2604D1"/>
</head>
<body>
...
...
<div width="100%" id="_pc3!chdextr" class="vbox">
<span id="_pc3">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="javascripts/prototype.js" type="text/javascript"></script>
<script src="javascripts/effects.js" type="text/javascript"></script>
<script src="javascripts/combo.js" type="text/javascript"></script>
</head>
</span></div>
...
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3695312
By: henrichen
The zul <html> component is an insertion point that you can put ANY HTML tag in there. Here you put <head> there so ZK just do what you want it to do. I mean, the zul <html> component is not the HTML <html> tag. It is only a convenient way for you to mix zul with HTML tags.
In your example, can't the following work for you?
<window xmlns:h="http://www.w3.org/1999/xhtml" title="ACM 2.0" border="normal">
<h:script src="javascripts/effects.js" type="text/javascript"/> ...
/henri
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3696492
By: nobody
hi henry,
is this correct way to call javascript.
<h:a href="javascript:Effect.Combo('content', {duration: 1, scaleX: true,
scaleContent: true});">About</h:a>
i am getting a javascript error saying something like method is not supported...
it worked for me in my jsp page.
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3696950
By: henrichen
The way looks ok to me. Is the js function (Effect.Combo) from a js library?
If so, is it possible to give me the source file so I can check it here. Thanks.
/henri
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3696964
By: henrichen
Is that effects.js from script.aculo.us? If so, can I ask which version you are using?
/henri
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3697968
By: nobody
yes it is from script.aculo.us. the thing is, it worked for me when I used it in my JSP page. now, i wanted to use the same in the zul file and running into this problem. i am using the same js file that i used with my jsp page.
i dont see any version info in the js page. here is what i am calling.
Effect.Combo = function(element) {
element = $(element);
if(element.style.display == 'none') {
new Effect.OpenUp(element, arguments[1] || {});
}else {
new Effect.CloseDown(element, arguments[1] || {});
}
}
Effect.OpenUp and new Effect.CloseDown are from script.aculo.us js. i am also
including the prototype.js.
As said, it is working for me in JSP but not in zul file. That's troubling me.
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3698604
By: henrichen
I don't know if you have noticed. ZK uses the effects.js and prototype.js, too.
I am not sure whether there will be any conflict if you include again the two javascript lib.
I need your help to get things done. Can you provide a reduced but complete zuml page that would replicate the issue so I can trace the problem here.
/henri
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3699253
By: nobody
Thats what i had guessed. I did not see that explicitly in the page source on the browser. But here is the zul file.
<?xml version="1.0" encoding="UTF-8"?>
<window title="ACM 2.0" border="normal" xmlns:h="http://www.w3.org/1999/xhtml"
xmlns:zk="http://www.potix.com/2005/zk">
<vbox>
<h:script src="javascripts/prototype.js"
type="text/javascript"/>
<h:script src="javascripts/effects.js" type="text/javascript"/>
<h:script src="javascripts/combo.js" type="text/javascript"/>
<h:div id="content"
style="display: none; width: 600px; padding: 2px;">
ACMNG is the next generation product for account management
console.
</h:div>
<separator bar="true" />
<h:div id="footerdiv" align="center">
<h:a
href="javascript:Effect.Combo('content', {duration: 1, scaleX: true, scaleContent:
true});">
About
</h:a>
</h:div>
</vbox>
</window>
The combo js you have it above in the thread which in turn calling scriptaculo effects. i have downloaded this a month back. so i am not using the latest version. secondly, i am not yet using the latest version from zk, still using zk-1.2.0-RC. thanks for helping to find the issue!
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3699429
By: henrichen
I will try it.
/henri
Asked: 2006-04-19 11:57:49 +0800
Seen: 924 times
Last updated: Apr 24 '06