The default setting is part of your part declaration:

qx.Class.define("foo",
{
   settings : { "custom.resourceUri" : "" }

});

This is to protect the application from unwanted settings and also is 
helpful to omit typos etc. The empty string in this case is the default 
value. If you have a look at the skeleton: it should look identical there.

Sebastian



Markus Bäurle schrieb:
> Hi, 
> 
> I have a problem with custom resources:
> 
> The qx.core.Setting.__settings map does contain the "custom.resourceUri" key
> but there is no defaultValue assigned but only a value => Error Setting
> "custom.resourceUri" is not supported by API.
> 
> The documentation says, that the window.qxsettings map is imported at
> application start. This happens in the qx.core.Setting.__init() method, but
> here only the value is set.
> 
> How to set the defaultValue?
> 
> The error is thrown, when the custom Widget-/IconTheme is loaded:
> 
> qx.Theme.define("custom.MyIconTheme",
> {
>    title : "My Icon Theme",
> 
>    icons :
>    {
>       uri : qx.core.Setting.get("custom.resourceUri") + "/icon_path" // This
> line causes the error
>    }
> });
> 
> 
> 
> Regards,
> Markus
> 
> 
> Edit: I fixed it temorary by just switching lines 127 - 129 with 131 - 133
> in qx.core.Setting.get():
> 
>     get : function(key)
>     {
>       var cache = this.__settings[key];
> 
>       if (cache === undefined) {
>         throw new Error('Setting "' + key + '" is not defined.');
>       }
> 
>       if (cache.value !== undefined) {
>         return cache.value;
>       }
> 
>       if (cache.defaultValue === undefined) {
>         throw new Error('Setting "' + key + '" is not supported by API.');
>       }
> 
>       return cache.defaultValue;
>     },
> 
> 


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to