Newbie question

1 view
Skip to first unread message

John Wiedey

unread,
Oct 19, 2009, 6:35:23 PM10/19/09
to QxTransformer
I'm evaluating QxTransformer for a project and making my way through
the docs. I'm particularly interested in the code life cycle. That
is, being able to update the xml and regenerate the js once the js
contains customizations.
http://sites.google.com/a/qxtransformer.org/qxtransformer/Documentation/generated-application-life-cycle
mentions that:

3) Calls post create UI function. Sometimes you need to do some
operations when your UI has been built. In this case you can use post
create function. You need to define initFunctionName (name will be
changed in future) attribute name in your qx:application tag.

but adding an initFunctionName line to my xml had no effect and I'm
suspicious because I don't see specific support for it in dialects/
qxml/templates/body/qx/application.mako

Can someone point me in the right direction, or is this not actually
supported?

Siarhei Barysiuk

unread,
Oct 20, 2009, 5:52:34 AM10/20/09
to QxTransformer
Hello John,

Thanks for your interest.

It seems you are using not the latest version. Could you please update
your copy from trunk?
We have not announced stable version yet since we don't have a lot of
feedback but trunk version works fine for us.

Let we know if you have any difficulties with this.


Serge

On Oct 20, 1:35 am, John Wiedey <jwie...@gmail.com> wrote:
> I'm evaluating QxTransformer for a project and making my way through
> the docs.  I'm particularly interested in the code life cycle.  That
> is, being able to update the xml and regenerate the js once the js
> contains customizations.http://sites.google.com/a/qxtransformer.org/qxtransformer/Documentati...

John Wiedey

unread,
Oct 20, 2009, 11:05:06 AM10/20/09
to QxTransformer
Now working fine from the trunk. Thanks. So I see how to use
'initFunctionName="startup" in the XML', but I have a very basic
follow-up JavaScript question. Instead of adding my new startup
function inline as shown below, how do I break it out into its own
separate .js file?

Thanks,
John


qx.Class.define("helloworld.Application",
{
extend : qx.application.Standalone,

members : {
main: function() {
this.base(arguments);
this.__qxtCreateUI();
this.startup();
},

startup : function() {
...
},

__qxtCreateUI : function() {
...
}

}
});

Christian Boulanger

unread,
Oct 20, 2009, 11:21:45 AM10/20/09
to qxtran...@googlegroups.com
Hi. I have never used the initFunctionName feature, but it seems to me
that you would not put your method into the generated javascript file.
Instead, either extend the generated file or have the file extend a
base class - a "code behind" class as Siarhei shows on the website:

http://sites.google.com/a/qxtransformer.org/qxtransformer/Documentation/component-model

your method then should be in the extending or extended class.

Christian

2009/10/20 John Wiedey <jwi...@gmail.com>:

Siarhei Barysiuk

unread,
Oct 20, 2009, 11:25:26 AM10/20/09
to qxtran...@googlegroups.com
Right.

That's what you need to do:

1) create a class which extends qx.application.Standalone

qx.Class.define("helloworld.ApplicationInit",
{
extend : qx.application.Standalone,

members :
{
startup: function() {
alert('startup');
}
}
});

2) add extend="helloworld.ApplicationInit" to qx:application tag.

That's it. So, startup function from helloworld.ApplicationInit class
will be used.

Let me know if you have any further questions.

Serge
Reply all
Reply to author
Forward
0 new messages