问题
I have a full-grown qooxdoo desktop application and a freshly created mobile application. I want to reuse existing classes from my desktop app in my mobile app. I modified the configuration file so that the compiler knows about the paths.
Just adding a desktop widget to a mobile page is not possible because they seem to be completely incompatible:
var title = new myapp.ui.basic.Label("Test");
page1.getContent().add(title);
produces:
Uncaught TypeError: Object #<HTMLDivElement> has no method 'add'
Is there another way to use desktop classes in a mobile app?
回答1:
You can use a Class defined for desktop in mobile apps as well but this excludes widgets. qooxdoo has a separate UI Toolkit optimized for mobile which should be used. The widgets for desktop are different and not compatible. Still, you can reuse all your IO and logic classes without a problem.
回答2:
If you are looking for inspiration have a look at the Feedreader application that provides 3 different frontends (desktop, mobile, web) but shares all of the logic.
来源:https://stackoverflow.com/questions/17428805/qooxdoo-reuse-desktop-classes-in-mobile-application