-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I have created a simple GWT HTML page that looks like this :
<html>
<head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> <title>Title</title> <link rel="stylesheet" type="text/css" href="css/common.css"/> <script type="text/javascript" src="search/search.nocache.js"></script> </head>
<body>
<iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0">
</iframe>
<noscript>
<div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif">
Your web browser must have JavaScript enabled in order for this
application to display correctly.</div>
</noscript>
...
<div class="main">
...
</div>
</body>
</html>
Now I want to convert this page into zul. I've changed the extension into zul and added namespace declarations in the <html> and tag like this :
<html xmlns="native" xmlns:zul="zul" xmlns:h="xhtml"> ... </html>
That works ok, but there's one small catch : whenever I want to load this zul, I have to refresh it manually (by hitting F5) in order for GWT part to start working. Chrome console will throw one error stating that search.nocache.js cannot be found (for some reason). When I refresh, everything is ok. I've also seen that jsessionid= is appended to nocache.js at the end, after ";", not sure if that's causing trouble or something else.
The reason why I embedded gwt into zul is because my web app was written in zk and I want to utilize gwt app and zk sessions.
Am I missing something here? Is there a better approach?
Please help.
Hey thanx for answering.
I doesn't work. I've tried putting it in <head> and <body> and gwt part simply won't load.
The only way I've managed it to get working is to use <?script ... ?>
tag, but then again F5 needs to be pressed to load gwt part.
Any more ideas?
No..I have complex javascript calculations and I'm bad at javascipt..that's why I decided to use gwt since everything can be written in the plain-old java. On the other side, webapp iz written in zk, so I have to figure out how to combine those two.
It seems like sessions are problem here : if I already have a session (session cookie) in the browser, my zk+gwt app loads fine. The problem is only when you delete browser history/cache it needs F5 to start working, not sure why.
Better approach would probably be to utilize client-side programming in zk and to discard gwt completely, but as I said, I'm bad at javascript.
Ahh yes, all widgets on the page are zk widgets, so no gwt widgets at all (they are very primitive anyway).
And one more thing..the problem with nocache.js not being found was Jetty : it tends to append ;jsessionid at the end, but I solved this by disabling cookieless sessions (url rewriting). Problem with F5 unfortunately still exists.
Asked: 2013-11-05 16:36:16 +0800
Seen: 43 times
Last updated: Mar 29 '17
How to pass a dynamic data as a argument of js function in .ZUL
ZK +Java Script Integration Issue ?
Script for override onOpen event of bandbox
How to access static member field of a class in zul without zscript
How to get all the selected items inside a tree model
Theme javascript wpd file not found
Radiogroup: problem with radio value="true"
zk mvvm > what's the best component to make LOV (list of value) of a master data [closed]