Persistent dashboard widget settings

I am creating a Dashboard Widget and I am trying to save the settings that are saved in "sessions" (ie the user closes the widget and reopens it).

I tried:

function setEmail(event)
{
var preferenceKey = "email";
var preferenceValue = $F("email");
widget.setPreferenceForKey(preferenceValue, preferenceKey);
}

function getEmail() {
var preferenceForKey = "email";
preferenceForKey = widget.preferenceForKey(preferenceForKey);
return preferenceForKey;
}

      

This works great for the current session, but if the widget is closed and reopened, the data will be lost.

Thanks!

0


a source to share


1 answer


This looks like a trick:



// Values you provide
var preferenceKey = "key";      // replace with the key for a preference
var preferenceValue = "value";  // replace with a preference to save

// Preference code
widget.setPreferenceForKey(preferenceValue, preferenceKey);

      

+2


a source







All Articles