Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

190
Views
How to split Qooxdoo project into logical separate .JS files

I am trying to make use of the import and export module functions in Javascript in a Qooxdoo application.

I want to create an instance of "session" defined in my session.js (see file contents) below, in my main application, but the import statement:

"import {session) from 'session.js'; "

Needs to be higher up in the code chain than application.js? (I get an error saying that when I try that approach). I am not sure where else that import statement could go? I have tried some of the other .JS project files without any success.

In the application code I would create a new instance of session using something like this:

"let mysession = new session();"

That is my theory anyway!

All I am trying to do is split code into separate .js files, so that it is easier to manage.

The "included" files will only be used in this project. And I am updating them as I go along. So I would not like to have to rebuild them separately when doing a build of the application.js file.

I might be making this way too complicated.

I have done some playing around with a very old version of Qooxdoo years ago, but the current Qooxdoo is clearly very different. According to my old code it seemed like it was possible to reference other files by using Javascript statements like "var session = test.general.session.getInstance();". But this no longer seems to work?

If someone could point me in the right direction, I would be very grateful. I have hunted through the Qooxdoo Web site, but cannot seem to find anything relevant, of course I might be missing what I am looking for!

Thanks in advance.

Lisa.

Very abbreviated contents of the file "session.js".

qx.Class.define('session',
{
  extend : qx.core.Object,
  type : 'singleton',

  construct: function ()
  {
    this.base(arguments);
    this.datasetName = 'Test Dataset';
    this.userFirstName = 'Dave';
    this.userSurname = 'Smith';
  },

  members:
  {
    datasetName : null,
    userFirstName : null,
    userSurname : null,
    tblmdlOpenForms : null,
    currentOpenForm : null,
    currentOpenWindow : null,
    __OpenFormIndex : null,

    __menuOptionAlreadyOpen : function(option)
    {
      if (this.currentOpenForm == option)
        return true
      else
        return false
    },   
}
});

export {session};
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

qooxdoo dependencies system is different. There is no need to include qooxdoo classes manually in source code. It's done automatically during compilation (discovering dependencies, linking them and etc). If you use desktop version of qooxdoo import and export don't work and they are just not needed.

You have a project name which have to be used in class name. For example your project is called myproject and you included session file in this project. In this case full class name must be myproject.session.

Now about getInstance method. The method still exists and you can use it but only with singleton class. Can't rightly understand what you want to do with it. Would be nice if you create separate question about it.

If you want to include other script (non qooxdoo module or file) read about this here

Edited: What I described above about qooxdoo 6.* version. Since 7.1 version you can import and use either es6 or CommonJS modules. Read about it here.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!