Hi Leon,

Leon Wang wrote:
> Hi Everyone, Hi Marius,
> I was wondering when I embed a GWT application, the Mail sample,  provided
> by GWT SDK into Xwiki page like this:
> 
> <script type="text/javascript" language='javascript'
> src='js/xwiki/mail/mail.nocache.js'></script>
> 
> why this GWT application would not appear in the Xwiki page, nothing
> happened? I have read the
> http://code.google.com/webtoolkit/doc/1.6/DevGuideOrganizingProjects.html
> 
> <http://code.google.com/webtoolkit/doc/1.6/DevGuideOrganizingProjects.html>In
> "The Bootstrap Sequence" section, it has an example
>     7. myApp/myApp.nocache.js completes, and the compiled script (
> <hashname>.cache.html) begins fetching in a hidden IFRAME (this is
> non-blocking).
>     8. <hashname>.cache.html completes. onModuleLoad() is not called yet, as
> we're still waiting on externalScriptOne.js to complete before the document
> is considered 'ready'.
>     9. externalScriptOne.js completes. The document is ready, so
> onModuleLoad() fires.
> 
> Why in the Xwiki page, the onModuleLoad() seems does not work?

Here's what I did:

1. Downloaded and unpacked GWT 1.7.0
2. Copied samples/Mail/war/mail directory from GWT to resources/js/xwiki 
directory in XWiki Enterprise
3. Edited a new page in Wiki mode and wrote this code:

{{velocity}}$xwiki.jsfx.use("js/xwiki/mail/mail.nocache.js"){{/velocity}}

4. Saved and viewed the page

As a result, part of the GWT mail sample application is visible at the 
bottom of the page. Unfortunately it was written to work with an empty 
HTML body: the UI is appended to the HTML body and window scrollbars are 
disabled.. You can't specify a container (e.g. a DIV with some id) where 
the UI should be hooked.

In order for a GWT application to integrate well in any HTML page its 
author must let you specify where exactly to hook the UI. Usually the 
container is specified by its id.

In you case, make sure the JavaScript file are loaded. To check this 
with Firebug you can go either to the HTML tab and inspect the head 
element or to the Script tab and look in the drop down list of loaded 
scripts.

Hope this helps,
Marius

> 
> PS: I am willing to contribute to Xwiki, what can I do for you guys? What I
> can think of is that I have poster presentation at the Graduate Research
> Forum on November 6, 2009, I will present my work on posters and I  print
> and hand out some flyers about Xwiki to people to give Xwiki a advertise.
> What do you guys think of. If anything I could help please let me know.
> 
> Thank you all.
> 
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to