kanugula schrieb:
> Thanks for your reply.
>
> I tried the following, but still didn't work. The source/build version gives
> a warning saying  'require(my.ServerConfig) is auto-detected'.
>
> Anyway, this is a minor issue. I re-arranged my code and removed static
> initializer.
>
> Thanks.
> Kanugula.
>
> /*
> #require(my.ServerConfig)
> */
>
> Fabian Jakobs-2 wrote:
>   
>> Hi Kanugula,
>>     
>>> Hi,
>>>
>>> Why is this not working?
>>>
>>> qx.Class.define("myGui",
>>> {
>>>     extend : myAbstractGui,
>>>     
>>>     properties :
>>>     {
>>>       rpcUrl :
>>>       {
>>>               init :
>>> my.ServerConfig.getServiceUrl()+"?request=delete&system=mySystem",
>>>               nullable : false
>>>       }     
>>>    },
>>>
>>> }
>>>
>>> qx.Class.define("my.ServerConfig",
>>> {
>>>        statics :
>>>        {                          
>>>              getServiceUrl : function()
>>>              {       
>>>              if (qx.core.Variant.isSet("qx.debug", "on"))  {
>>>                  return 
>>> "http://localhost/web/.qxrpc?instanceId=server.debug";;
>>>              }
>>>              else {
>>>                  return qx.io.remote.Rpc.makeServerURL();        
>>>              }
>>>              }
>>>        }
>>>        
>>> });
>>>       

BTW you can rewrite you method to be a bit faster:

getServiceUrl : qx.core.Variant.select("qx.debug",
{
  "on" : function() { return 
"http://localhost/web/.qxrpc?instanceId=server.debug";; },
  "off" : function() { return qx.io.remote.Rpc.makeServerURL(); }
}),


This way the variant is only checked at class define time and not each 
time the method is called.

Best Fabian

-- 
Fabian Jakobs
JavaScript Framework Developer

1&1 Internet AG
Brauerstraße 48
76135 Karlsruhe

Amtsgericht Montabaur HRB 6484

Vorstand: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Thomas 
Gottschlich, Matthias Greve, Robert Hoffmann, Markus Huhn, Oliver Mauss, Achim 
Weiss
Aufsichtsratsvorsitzender: Michael Scheeren


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to