Hi Leon,
Leon Wang wrote:
Hi Marius,
Thank you for your help! I am quite touched you actually tried to load the
Mail example in Xwiki page. I followed your code in the 1.6 version. Here is
the screenshot link:
http://picasaweb.google.com/lh/sredir?uname=freeleons&target=PHOTO&…
It seems works on Firefox (It is clickable but still something broken
maybe it is the sizing not right) it does not work on Google Chrome at all.
At the top of the page Firefox can display it well Chrome will display
nothing. At the bottom of the page both on Chrome and Firefox will display
these:
//
xwe.onInjectionDone('xwe')
//
//
xwe.onInjectionDone('xwe')
//
//
xwe.onInjectionDone('xwe')
//
//
xwe.onInjectionDone('xwe')
//
<script defer="defer">
moduleName.onInjectionDone('moduleName')
</script>
is generated by GWT's default bootstrapper. Make sure you include the
moduleName.nocache.js file just once. Also make sure you use the
JavaScript file extension plugin
$xwiki.jsfx.use("path/to/moduleName.nocache.js")
to include the JavaScript code so that it ends up in your HTML page's
head not body, otherwise the JavaScript code might be parsed as wiki
syntax before reaching the browser and thus will be messed up.
Here is the screenshot:
http://picasaweb.google.com/lh/sredir?uname=freeleons&target=PHOTO&…
It completely broken and nothing clickable. Later I found the srollbar
disable because this line in the Mail source
code: Window.enableScrolling(false);
Thank you for your help so I can get this far. Do you know why the the Mail
appear both at the very top of the page and also at the very bottom of the
page, and the bottom is completely broken? The mail.nocache.js successfully
loaded according to firebug.
And here is my code:
public void onModuleLoad() {
loadingUI();
}
private void loadingUI(){
String hookId = "DR_TreeView";
Element hook = DOM.getElementById(hookId);
if (hook == null) {
return;
}
// Prepare the DOM
Element container = DOM.createDiv();
String containerId = hookId + "_container";
container.setId(containerId);
hook.getParentElement().replaceChild(container, hook);
DockPanel outer = initialUI();
RootPanel.get(containerId).add(outer);
// Call the window resized handler to get the initial sizes setup.
Doing
// this in a deferred command causes it to occur after all widgets'
sizes
// have been computed by the browser.
DeferredCommand.addCommand(new Command() {
public void execute() {
onWindowResized(Window.getClientWidth(),
Window.getClientHeight());
}
});
onWindowResized(Window.getClientWidth(),
Window.getClientHeight());
Why do you call onWindowResized twice? The comment says it should be
called just once with a deferred command so that it gets executed after
all the widgets are rendered. Otherwise your code looks good.
Hope this helps,
Marius
}
Thank you a lot!
-Leon
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs