Download qooxdoo Documentation
Transcript
qooxdoo Documentation, Release 1.2
• Make sure the relative paths on the web server match those on your file system, e.g. if your app lives on the file
system at /a/b/A/myapp and your qooxdoo installation is at /a/b/Z/qooxdoo-sdk and the server path to your app
is /web/apps/myapp then make sure the server path to qooxdoo is /web/Z/qooxdoo-sdk so that relative references
like ../Z/qooxdoo-sdk will work under the web server.
A simple way to achieve this is to map the DocumentRoot or an Alias to a directory in your file system that is a
common parent to all involved qooxdoo components of your app.
Relax Firefox 3 File URI Restriction
Firefox 3 will by default employ a strict same-origin-policy concerning file URIs, ie. URIs loaded with the
%%file://%% protocol. This can lead to errors when you run the source version of your app from the file system, particularly when your app uses parts. In order to relax this strict policy for file URIs, enter about:config in
the location bar of your browser and apply the following setting:
security.fileuri.strict_origin_policy : false
Coding
Center a window on screen
Here is the solution:
var win = new qx.ui.window.Window();
// first solution
win.addListener("resize", function(){
this.center();
}, win);
// second solution
win.addListener("resize", win.center, win);
this.getRoot().add(win);
win.open();
This solution works even if we don’t know the real size of the window, because it depends on its content.
Before the window is shown and know its real size, we place it at the center. We use the resize event instead of
the appear event to prevent any flickering, because when using the appear event the window is already visible
and then moved to the center. With the resize you can center the window right after the inserting in the DOM (the
widget resizes) and avoid any flickering.
Focus a widget inside a window
Here is the solution:
var win = new qx.ui.window.Window();
win.setLayout(new qx.ui.layout.Canvas);
var field = new qx.ui.form.TextField;
win.add(field)
field.focus();
272
Chapter 7. Development