Gadgets with default userpref values are not available when rendered
--------------------------------------------------------------------

                 Key: SHINDIG-175
                 URL: https://issues.apache.org/jira/browse/SHINDIG-175
             Project: Shindig
          Issue Type: Improvement
          Components: Gadgets Server - Java
            Reporter: Barnaby James
            Priority: Minor


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="[EMAIL PROTECTED]"
               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) {
                alert("Missing default value for foo");
              } else {
                alert("foo Pref Default Val: " + foo);
              }
            </script>

            <div id="content-div__MODULE_ID__">Test Prefs Work</div>
        ]]>
  </Content>
</Module>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to