You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by "John Hjelmstad (JIRA)" <ji...@apache.org> on 2008/10/16 02:18:44 UTC

[jira] Updated: (SHINDIG-175) Gadgets with default userpref values are not available when rendered

     [ https://issues.apache.org/jira/browse/SHINDIG-175?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John Hjelmstad updated SHINDIG-175:
-----------------------------------

    Attachment: shindig-175.patch

Implementation for Java applied. JS updated to accommodate the use case. This JS should not affect other server functionality, as it is additive.

> 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: Gadget Rendering Server (Java)
>            Reporter: Barnaby James
>            Priority: Minor
>         Attachments: shindig-175.patch
>
>
> 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) {
>                 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.