Defining User Preferences
You may need to save user preference variables persistently within an
application’s OpenSocial gadget. This is where the UserPref
element comes into play. It allows you to configure which
variables you would like to store for a user. These configuration
variables, along with JavaScript features we will talk about in later
sections, provide simple key/value storage without requiring you to set up
a database.
UserPref
contains a number of
configurable attributes, listed in Table 3-7.
Table 3-7. UserPref attributes
Attribute | Description |
---|---|
| An optional string
that denotes the date type present within the user
preference variable. The value may be |
| An optional string that stores a default value for a user preference in the event that the user does not specify a variable configuration. |
| An optional string that represents the user preference during editing. This value must be unique. |
| The name of the user preference. This value is required and must be a unique value. |
| An optional Boolean value ( |
| If a |
Get Programming Social Applications now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.