How to use more than one namespaces?

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

How to use more than one namespaces?

voger
I have this directory structure (with the default stuff removed)

└── qssite
     ├── ui
     │   ├── STaskBarButtons.js
     │   ├── STaskBar.js
     │   ├── STaskButton.js
     │   ├── SToolBar.js
     │   ├── SUserActions.js
     │   ├── SWindow.js
     │   └── window
     │       └── SManager.js
     └── util
         └── BusHelper.js

I am in the process of refactoring so it has some inconsistency for now.

The util.BusHelper is just a simple utility function to dispatch
messages to the message bus. It has only one function and when I try to
call it from the qssite.ui.window.SManager with this code

qssite.util.BusHelper.dispachMessageToBus('manager-window-to-front',
win, this);

I get from the generate.py script

"Unknown global symbol used: qssite.util.BusHelper.dispachMessageToBus"

I know it has something to do with declared namespaces. I have read the
docs but I can't quite figure out how exactly can I make one namespace
available to the other. Should I change somehow the Manifest.json or the
config.json?

P.S.:  I am including here the code for the BusHelper class in case I
made a mistake

qx.Class.define('qssite.util.BusHelper', {
     extend: qx.core.Object,
     statics: {
         /**
          *
          * @param message {string: the message to be dispached}
          * @param data {object: Optional. The object to be dispached}
          * @param sender {Optional. The sender of the message}
          */
         dispachMessageToBus: function(message, data, sender) {
             var msg = new qx.event.message.Message(message);
             if(data !== undefined) {
                 msg.setData(data);
             }

             if(sender !== undefined) {
                 msg.setSender(sender);
             }
             qx.event.message.Bus.getInstance().dispatch(msg);
         }
     }
});




------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
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 more than one namespaces?

voger
Update: I found this message from 2012.
http://qooxdoo.678.n2.nabble.com/How-to-set-up-a-custom-shared-namespace-and-use-in-my-project-in-Qooxdoo-td7365092.html

I did what mr. Herchenroeder suggested in the second post and it works
great and looks like a more clean solution. Still I would like to know
if it is possible to do it like I was trying initially. If yes, how?

On 08/03/2015 10:12 μμ, voger wrote:

> I have this directory structure (with the default stuff removed)
>
> └── qssite
>       ├── ui
>       │   ├── STaskBarButtons.js
>       │   ├── STaskBar.js
>       │   ├── STaskButton.js
>       │   ├── SToolBar.js
>       │   ├── SUserActions.js
>       │   ├── SWindow.js
>       │   └── window
>       │       └── SManager.js
>       └── util
>           └── BusHelper.js
>
> I am in the process of refactoring so it has some inconsistency for now.
>
> The util.BusHelper is just a simple utility function to dispatch
> messages to the message bus. It has only one function and when I try to
> call it from the qssite.ui.window.SManager with this code
>
> qssite.util.BusHelper.dispachMessageToBus('manager-window-to-front',
> win, this);
>
> I get from the generate.py script
>
> "Unknown global symbol used: qssite.util.BusHelper.dispachMessageToBus"
>
> I know it has something to do with declared namespaces. I have read the
> docs but I can't quite figure out how exactly can I make one namespace
> available to the other. Should I change somehow the Manifest.json or the
> config.json?
>
> P.S.:  I am including here the code for the BusHelper class in case I
> made a mistake
>
> qx.Class.define('qssite.util.BusHelper', {
>       extend: qx.core.Object,
>       statics: {
>           /**
>            *
>            * @param message {string: the message to be dispached}
>            * @param data {object: Optional. The object to be dispached}
>            * @param sender {Optional. The sender of the message}
>            */
>           dispachMessageToBus: function(message, data, sender) {
>               var msg = new qx.event.message.Message(message);
>               if(data !== undefined) {
>                   msg.setData(data);
>               }
>
>               if(sender !== undefined) {
>                   msg.setSender(sender);
>               }
>               qx.event.message.Bus.getInstance().dispatch(msg);
>           }
>       }
> });



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
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 more than one namespaces?

Richard Sternagel
Hi voger,

this should work, as long as you stay within the same namespace
(i.e. assuming that "qssite" is your top level namespace which would
mean that your app was created as "qssite").

Can you provide a stripped down downloadable example somewhere?

Regards
Richard

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
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 more than one namespaces?

voger
This is strange. While I was preparing a small example to upload, I saw
that really it works as I wanted in the beginning. Then, in the original
project, I reverted back as it was in my first message, and again it
works. I can't find any differences with what I did yesterday.



On 09/03/2015 04:18 μμ, Richard Sternagel wrote:

> Hi voger,
>
> this should work, as long as you stay within the same namespace
> (i.e. assuming that "qssite" is your top level namespace which would
> mean that your app was created as "qssite").
>
> Can you provide a stripped down downloadable example somewhere?
>
> Regards
> Richard
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming The Go Parallel Website, sponsored
> by Intel and developed in partnership with Slashdot Media, is your hub for all
> things parallel software development, from weekly thought leadership blogs to
> news, videos, case studies, tutorials and more. Take a look and join the
> conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

How to get an Object from existing HTML source

Bober
Hi,
 
in my Desktop-App, I would like to get an Instance of an Object for an CodeMirror Object that is created in an qx.ui.embed.Html("...").
 
In the JavaScript Console I can access the Object by using JQuerry:
 
var editor = $('.CodeMirror')[0].CodeMirror;
 
Then I can edit the code in the editor by using 
editor.setValie("1+2");
 
How is this possible within a qooxdoo Deksop application?
 
I was thinking about using something like qx.bom.Collection.query or qx.dom.... but nothing seems to work.
 
 
Thanks for your help!
 
 
Regards,
 
Bober

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
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 get an Object from existing HTML source

Andreas Parusel
Hi,

qooxdoo has an own query-API which is equivalent to jQuery in most cases. Simply replace ‚$‘ with ‚q‘ or ‚qxWeb‘:

qxWeb('.CodeMirror')[0].CodeMirror;

This should do the trick!

Best regards
Andreas
 
Am 10.03.2015 um 12:02 schrieb [hidden email]:

Hi,
 
in my Desktop-App, I would like to get an Instance of an Object for an CodeMirror Object that is created in an qx.ui.embed.Html("...").
 
In the JavaScript Console I can access the Object by using JQuerry:
 
var editor = $('.CodeMirror')[0].CodeMirror;
 
Then I can edit the code in the editor by using 
editor.setValie("1+2");
 
How is this possible within a qooxdoo Deksop application?
 
I was thinking about using something like qx.bom.Collection.query or qx.dom.... but nothing seems to work.
 
 
Thanks for your help!
 
 
Regards,
 
Bober
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel