Fb:multi-friend-selector (condensed)

From Facebook Developers Wiki

Jump to: navigation, search

Contents

[edit] Description

There are actually two versions of this button - the full version and the condensed version. This page describes the condensed version. For information about the full version, see fb:multi-friend-selector.

This is a more condensed version of an interface which must be used inside an fb:request-form to select some number of friends to send an invitation or request. This interface includes a series of <input type="checkbox" name="ids[]" value="[friend id]"> which is included for selected users in the form that gets submitted to your <fb:request-form> action URL. For more information, check out fb:request-form.

There are two versions of the condensed multi-friend-selector - a one box version and a two box version. With selected_rows set to 0, the one box version appears; it works like a normal check box where clicking a user selects that user. With selected_rows set to anything larger, the two box version is used; this results in an upper list containing unselected users and a lower list containing selected users.

The condensed multi-friend-selector behaves like a normal block level element, which is to say that you can style it with a style attribute or by giving it a CSS class, and its width stretches to fit into the containing block.


[edit] Attributes

RequiredNameTypeDescription
required condensed bool Set this to true to use the condensed version of the multi-friend-selector. If not set, the full fb:multi-friend-selector is used.
optional max int The maximum number of users that can be selected. This value ranges from 1 to 35, and is capped at the number of friend requests the user has remaining under their limit. This attribute is ignored if it is greater than the number of requests your application is able to send.
exclude_ids array A comma-separated list of user IDs to exclude from the condensed multi-friend-selector.
unselected_rows int The number of rows of friends to display in the unselected part of the condensed multi-friend-selector. (Default value is 6, and must be a number between 4 and 15.)
selected_rows int The number of rows of friends to display in the selected part of the condensed multi-friend-selector. (Default value is 5, and must be a number between 5 and 15; or set it to 0 to indicate that you want only a single box for both selected and unselected friends.)


[edit] POST Variables

RequiredNameTypeDescription
ids array An array of the user IDs chosen by the user.


[edit] Examples

<div style="padding: 10px;"> <fb:request-form method="post" action="index.php" content="hey" type="sample" invite="true"> <div class="clearfix" style="padding-bottom: 10px;"> <fb:multi-friend-selector condensed="true" style="width: 200px;" /> </div> <fb:request-form-submit /> </fb:request-form> </div>
picture27cy5.png


<div style="padding: 10px;"> <fb:request-form method="post" action="index.php" content="hey" type="sample" invite="true"> <div class="clearfix" style="padding-bottom: 10px;"> <fb:multi-friend-selector condensed="true" selected_rows="0" style="width: 200px;" /> </div> <fb:request-form-submit /> </fb:request-form> </div>
picture28as0.png