It's all fine, except that you are using the qooxdoo convention for 
*private* members, a leading "__". Put that away, and your code should 
run in both versions.

T.

On 03/07/2011 12:27 PM, slah wrote:
>
>
> Hello,
> Please tell me if I'm using best practices for global var declarations,
> I've created a file Globals.js which holds my global vars, then when I tried
> to get my vars from another call
> using fully qualified name, in source version it does work and alerts the
> value of my var, but in the build version it said
>
> "Uncaught TypeError: Cannot read property 'sid' of undefined"
>
> Any help please.
>
> Do I have to include the Globals.js anywhere in the login class or ... I'm
> running out of ideas.
>
> Please find below a summary of the source code:
>
> ------------------------------------------------------------
> (Globals.js)
> /*
>   * Global vars
>   * */
> qx.Class.define("tsk.Globals", {
>         extend: qx.core.Object,
>         statics :
>             {
>                 //Cookie key names
>                __cookie     : {rememberme : "rememberme", username : "user",
> password : "passwd", locked : "locked", sid : "sid"},
>                // rpc default call values
>                __rpc        : {url : "http://127.0.0.1:8081";, timeout :
> 60000, crossdomain : true},
>                     //user connection params
>                         __sid : null, //session id needed when sending any 
> request to server.
>                         __user : null, //user name.
>                         __pass : null, //user password (sould be encrypted in 
> the future with
> qx....encrypt)
>                         __lastlogin : null //last login date
>               
>             }
>          });
>
> ---------------------------------------------------------------
> (login.js)
>   /**
>   * The check login window
>   */
> qx.Class.define("tsk.tools.login",
> {
>       extend : qx.ui.window.Window,
>
>       /*
>       *
> ****************************************************************************
>       * CONSTRUCTOR
>       *
> ****************************************************************************
>       */
>
>       /**
>       * @param controller
>       *            {tsk.Application} The main application class
>       */
>       
>       construct : function(controller)
>       {
>               this.base(arguments, this.tr("Login TSK System"));
>
>               //check if the session is not open and if the app wasn't locked.
>               alert(elaweb.Globals.__cookie.sid); //works in source but not 
> in build :(
>               ....
>
> --
> View this message in context: 
> http://qooxdoo.678.n2.nabble.com/Build-and-source-version-for-global-vars-tp6096932p6096932.html
> Sent from the qooxdoo mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> What You Don't Know About Data Connectivity CAN Hurt You
> This paper provides an overview of data connectivity, details
> its effect on application quality, and explores various alternative
> solutions. http://p.sf.net/sfu/progress-d2d
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>

------------------------------------------------------------------------------
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to