The class that call the qx.Class.getByName does not contains any reference to 
the class to be created (like the case of "var abc = new ml_23sept.MyClass();" 
commented out): is a child object that, via events, tell which class (by name)  
has to be instantiated.

So, this is the reason why is not working as I expected?


Il giorno 23/set/2013, alle ore 17:34, Richard Sternagel 
<[email protected]> ha scritto:

> Hi dbrec,
> 
> so here is my assumption:
> 
> It seems that somehow during the "source" run the class in question was 
> included and during "build" it wasn't. The "q is not a constructor"
> message (more precisely the "q") is likely coming from the variable 
> renaming [1].
> 
> I'm just guessing but could it be that you have run "./generate source" 
> changed some code and then run "./generate build"? Because then I am 
> able to reproduce this:
> 
> # source run => everything works:
> ---
> var abc = new ml_23sept.MyClass();
> var myClass = qx.Class.getByName("ml_23sept.MyClass");
> var object = new myClass();
> object.doSomething();
> ---
> 
> vs. afterwards
> 
> # build run => "myClass is not a constructor" resp. "q is not ...":
> ---
> // var abc = new ml_23sept.MyClass();  --> line is commented out
> var myClass = qx.Class.getByName("ml_23sept.MyClass");
> var object = new myClass();
> object.doSomething();
> ---
> 
> Because of the commented out line "ml_23sept.MyClass" isn't seen by the 
> Generator and therefore it won't be included in the generated script 
> file - and will be missing during runtime.
> 
> So in order to force the Generator to always include a certain class you 
> could for example attach to the enclosing method/class JSDoc comment 
> something like that [2]:
> 
> ---
> /**
>  * ...
>  * @use(ml_23sept.MyClass)
>  * ...
>  */
> ---
> 
> But this should be used with caution because it obviously leads to 
> bloated script files, which stupidly include all the classes you asked 
> for, somewhere in your code.
> 
> Another option would be to make sure, that the classname/s is/are always 
> referenced somewhere else in the code and thus the Generator is able to 
> pick them up, e.g.:
> 
> ---
> var foo = {
>   "bar": ml_23sept.MyClass
> };
> ---
> 
> Maybe that helps.
> 
> Regards
> Richard
> 
> [1] 
> http://manual.qooxdoo.org/3.0.1/pages/tool/generator/generator_optimizations.html#variables
> [2] http://manual.qooxdoo.org/3.0.1/pages/development/api_jsdoc_ref.html#use
> 
> ------------------------------------------------------------------------------
> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
> http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to