As I understand when I run *generate.py source* it parses the sources and
includes all the namespaces/classes that are needed in the generated js
file.
That's why, I guess, we have the following in an Application class:

        // support native logging capabilities, e.g. Firebug for Firefox
        qx.log.appender.Native;
        // support additional cross-browser console. Press F7 to toggle
visibility
        qx.log.appender.Console;

i.e. to force including these two classes.

My question is: is there any possibility to "include a class" during the
runtime. I read about *parts,* I know that for production it's not a problem
and even for development I can just use *generate.py souce-all *. But if
possible and easy (I probably missed it) I'd like to make it loading "on
demand" just to make the development stage a bit more comfortable.

I tried something like this:

// check if the class is defined
if (!qx.Class.isDefined(controllerClass)) { // let's say controller class is
a string equal to 'myapp.controller.MainWindow'
  var scriptLoader = new qx.io.ScriptLoader();
  var controllerClassUri = 'class/myapp/' + controllerClass.replace('.',
'/'); // this should form uri for loading the file with the class. Let's
assume it really lies there.
  scriptLoader.load(controllerClassUri);
}

There were some different errors while I was trying and I thought it wasn't
worth it. But may be somebody knows a way?..


-- 
Alexander Steshenko | http://lcf.name
------------------------------------------------------------------------------

_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to