diff -r 913c9751c067 -r 716254ccbcc0 org.symbian.tools.wrttools.doc.WebDeveloper/html/GUID-DF4D8745-B6D4-4BC4-AF2D-0F71F28E9F27.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/org.symbian.tools.wrttools.doc.WebDeveloper/html/GUID-DF4D8745-B6D4-4BC4-AF2D-0F71F28E9F27.html Fri Mar 05 19:11:15 2010 -0800 @@ -0,0 +1,34 @@ + + +
Description:
+The setPreferenceForKey
method allows a key to be stored along with its associated preference. The arguments are like name and value pairs. The preference value for the key is stored persistently, so if the widget or device is restarted, the value is retained. However, the values stored by a widget are removed when a widget is uninstalled from the device. This includes the case when a widget is reinstalled; where the old widget is uninstalled, the new widget is installed.
An existing preference can be overwritten with a new value by simply calling the method with the same key and new value.
+A stored preference for a key can be removed by calling the method with the preference
argument set to null
Syntax:
+[void] window.widget.setPreferenceForKey(String preference, String key)+
or
+[void] widget.setPreferenceForKey(String preference, String key)+
Arguments:
+preference
:
A text string specifying a reusable value to be stored.
+ +key
:
A short text string defined as the name of the preference to be stored.
+ +Return value:
+This method does not return a value.
+Example code:
+// Save the inputted Search key +var searchArg = document.forms[0].searchKey.value; +widget.setPreferenceForKey('searchKey',searchArg);+