how to use/init qxWeb inside desktop apps

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

how to use/init qxWeb inside desktop apps

benco

Hi,

I'm migrating a qx 2.0 desktop app. As I was using the now removed qx.bom.Collection class, I'd like to switch to qxWeb because using qx.bom.Selector() isn't comfortable enough in my case.

My problem is some modules aren't initialized when creating new objects. Here's an example:

old code

var prt = new qx.bom.Collection(domElement); // domElement is a
var target = prt.parents('p')[0];

 

new code [doesn't work]

var prt = new qxWeb(domElement); var target = prt.getParents('p')[0]; // throws an error: getParents() is not a function

 

new code [works but a bit hacky]

var prt = new qxWeb(domElement); var target = qx.module.Traversing.getParents.call(prt, 'p')[0];

 

How can I make sure the Traversing Module is initialised correctly ... ? In the config.json file ?

Best Regards,

Benoît

Reply | Threaded
Open this post in threaded view
|

Re: how to use/init qxWeb inside desktop apps

MartinWittemann
Administrator
Hey,
the qooxdoo toolchain can not detect dependencies to the modules. So you have to manage those dependencies by hand. The best thing is to require the code module in the class you need the collection API with a 
@require(qx.module.core)
in the class header and you should be good with most of the basic functionality. Everything missing has to be included the same way. After that, rebuild and the API is ready to use.
Regards,
Martin


Am 27.01.2014 um 16:09 schrieb benco <[hidden email]>:

Hi,

I'm migrating a qx 2.0 desktop app. As I was using the now removed qx.bom.Collection class, I'd like to switch to qxWeb because using qx.bom.Selector() isn't comfortable enough in my case.

My problem is some modules aren't initialized when creating new objects. Here's an example:

old code

var prt = new qx.bom.Collection(domElement); // domElement is a
var target = prt.parents('p')[0];
 

new code [doesn't work]

var prt = new qxWeb(domElement); var target = prt.getParents('p')[0]; // throws an error: getParents() is not a function
 

new code [works but a bit hacky]

var prt = new qxWeb(domElement); var target = qx.module.Traversing.getParents.call(prt, 'p')[0];
 

How can I make sure the Traversing Module is initialised correctly ... ? In the config.json file ?

Best Regards,

Benoît



View this message in context: how to use/init qxWeb inside desktop apps
Sent from the qooxdoo mailing list archive at Nabble.com.
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


------------------------------------------------------------------------------
WatchGuard Dimension instantly turns raw network data into actionable
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to use/init qxWeb inside desktop apps

benco
Thanks for the hint Martin :) !