shindig-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bruce Godden (JIRA)" <>
Subject [jira] Commented: (SHINDIG-181) gadgets.IfrGadget.prototype.getIframeUrl funtion in gadgets.js does not create correct default prefs for gadget
Date Wed, 16 Dec 2009 11:05:18 GMT


Bruce Godden commented on SHINDIG-181:

The code is slightly different to that described above; perhaps it has changed since it was

The getUserPrefsParams() function, and hence the getIframeUrl() function, uses the gadget
userPrefs property to generate the list of user preference settings. However, this is not
initialised during gadget creation and so is, initially at least, always empty. I think that
a call to fetch the current saved preferences should be added to the container addGadget()
function. (It can't be done sooner as the gadget id isn't set until then.)

  gadgets.Container.prototype.addGadget = function(gadget)
  { = this.getNextGadgetInstanceId();
    this.gadgets_[this.getGadgetKey_(] = gadget;
    gadget.userPrefs = this.userPrefStore.getPrefs(gadget);

I don't believe that it is right to try initialise the userPrefStore to the default values
specified in the gadget. The values that have been stored should be used and where no value
has been stored the default value specified by the gadget should be used. I assume that the
reason that the values are passed on the iframe is to allow Shindig to substitute the non-default
values correctly. It already has the information about the default values from the gadget

> gadgets.IfrGadget.prototype.getIframeUrl funtion in gadgets.js does not create correct
default prefs for gadget
> ---------------------------------------------------------------------------------------------------------------
>                 Key: SHINDIG-181
>                 URL:
>             Project: Shindig
>          Issue Type: Bug
>          Components: Javascript 
>         Environment: Windows XP, BEA weblogic 9.2
>            Reporter: Neil
>            Priority: Minor
> The gadgets.IfrGadget.prototype.getIframeUrl function in gadgets.js uses the getUserPrefsParams()
function to setup the default user prefs for the gadget, when creating the iFrame.
> However, this function uses the gadgets.container.userPrefStore object to obtain the
prefs.  Until the 'save' button on the settings dialog has been explicitly clicked - after
the gadget has been rendered to the browser - the gadgets.container.userPrefStore will be
empty for this gadget.
> The gadgets.container.userPrefStore should be initialised for this gadget with the default
user prefs given in the gadget spec, if any.

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

View raw message