Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
Description
The following gadget rendered in shindig without any user prefs on the URL (e.g. http://localhost:8080/gadgets/ifr?url=http://example.org/grm/defaultprefs.xml) doesn't have the default values available when it renders. prefs.getString("foo") returns an empty string.
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Test Default Prefs"
description="Test Default Prefs work"
directory_title="Default Prefs"
author="me"
author_email="me@example.org"
scrolling="false">
<Require feature="setprefs"/>
</ModulePrefs>
<UserPref name="foo" display_name="Phoney pref" datatype="string" default_value="bar"/>
<Content type="html">
<![CDATA[
<script type="text/javascript">
var prefs = new gadgets.Prefs();
var foo = prefs.getString("foo");
alert(foo);
if (foo.length == 0)
else
{ alert("foo Pref Default Val: " + foo); }</script>
<div id="content-div_MODULE_ID_">Test Prefs Work</div>
]]>
</Content>
</Module>