> Is it possible to define a class that has a static initializer? In other
> words, one that runs an arbitrary function to set up static class variables
> using an arbitrary function, then the class is first defined?
>
>
You mean something like this?:
qx.Class.define("xxx", {
...
statics : {
myDateFormat : qx.locale.Date.getDateTimeFormat("yyyyMMMM", "MMMM
yyyy")
...
}
Yes, this is possible, and even used in the framework (see e.g.
qx.ui.form.DateField). *But*, there is a caveat here. The generator
recognizes the static initializer as a load-time prerequisite of the
current class, but does not (yet) follow the initializer's run-time
dependencies. So you might run into unresolved dependency issues during
run time of your app. If so, you have to work around those by hand (e.g.
adding #require() hints in your classes, or "require" keys in your
config). See also this bug for background
(http://bugzilla.qooxdoo.org/show_bug.cgi?id=1455).
T.
>
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel