Fb:friend-selector

From Facebook Developers Wiki

Jump to: navigation, search

Contents

[edit] Description

Renders a predictive friend selector input for a given person. You can use this tag inside an fb:request-form to select users for whom a request can be sent.


[edit] Attributes

RequiredNameTypeDescription
optional uid int The user whose friends you can select. (default value is the uid of the currently logged-in user)
name string The name of the form element. (default value is friend_selector_name)
idname string The name of the hidden form element that contains the user ID of the selected friend. If you are using this tag inside fb:request-form, do not override the default. (default value is friend_selector_id)
include_me bool Indicates whether or not to include the logged in user in the suggested options. (default value is false)
exclude_ids array A list of user IDs to exclude from the selector. (comma-separated)
include_lists bool Indicates whether or not to include friend lists in the suggested options. (default value is false)


[edit] Examples

<fb:friend-selector uid="123445" name="uid" idname="friend_sel" />
friend-selector.jpg


[edit] Notes

  • If the user enters a name that does not match any of his friends, idname gets set to an empty string (instead of a uid number) and name gets set to the entered text.
  • If no value is entered then idname is not added as a hidden field in the POST.

[edit] Bugs

  • If a valid friend is entered and selected from the drop-down completion, the idname gets set to that person's uid and remains as that value unless another valid friend is entered. This means, if I enter a valid friend and then delete the entry to make it blank (or a non-friend), it sends that previous friend's uid in idname, but sends a blank string (or the non-friend's name) in name.
    • Just check if the name is empty. People don't usually submit a half-typed friend's name.


[edit] See Also

You can see a real world example of this tag in the Footprints demo application. Go to Demos for more details and to download and install the demo apps.