Creating a Person Selector: os:PeopleSelector
With the os:PeopleSelector tag,
a developer can add a container-styled drop-down list that
allows users to select from a group of people. The tag will also set a
form field with the associated value from the drop-down. This tag should
be added using syntax similar to the following:
<os:PeopleSelector group="${ViewerFriends}" multiple="false" max="10"
inputName="viewerFriends"/>The os:PeopleSelector tag has
several attributes that may be assigned to it, as listed in Table 7-8.
Table 7-8. os:PeopleSelector attributes
Attribute | Description |
|---|---|
| The group that should be displayed in the drop-down. This
may either be an array of OpenSocial |
| The name of the input box that will be used to store the selected IDs. |
| The maximum number of people that may be selected. |
| Whether multiple people may be selected. |
| The JavaScript function to invoke when a new person is selected. |
| The top-level |
You add the os:PeopleSelector
tag to a gadget using markup similar to the following:
<form action="inviteFriends" method="POST">
<os:PeopleSelector group="${ViewerFriends}"
multiple="true"
inputName="viewerFriends"/>
</form>Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access