Wednesday, November 6, 2013

Embedding gwt page in zkoss (zul) page

Hi,

I'm trying to embed a simple gwt app into a zul (zkoss.org) page, but I'm not sure how to do it. Here's what I came
up with so far :

- search.html (a simple html page that loads gwt nocache.js over <script> element in the header)
- search.zul (a simple zul page that reads session and shows who is logged in at the top of the page)

search.html manipulates DOM, while search.zul handles server-related tasks.

I tried to merge "gwt part" (basically gwt scripts) into search.zul and here's how I did it :

<?page title="Search" contentType="text/html;charset=UTF-8"?>
<?script src="search/search.nocache.js" ?>
<html xmlns="native" xmlns:zul="zul" xmlns:h="xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <title>Search</title>
    <link rel="stylesheet" type="text/css" href="css/search.css" />
   <!-- IT DOESN"T WORK HERE, NOT SURE WHY -->
<!-- <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>

...
</body>
</html>

The reason I'm doing this is because I want to utilize gwt for javascript generation only and zkoss as a server-side technology.

The problem : this will work, but every time you open this page you need to hit F5 in order for gwt part to load.
The question is how to load .nocache.js properly without refreshing?

Please, if anyone have any ideas, they are more than welcome.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment